@Override MatchRule reparent(final MatchRule newParent) { return new MatchNetworkRule(newParent, cidrAddress); }
/** * Create a new rule which is the same as this rule, but also matches the given Internet network address. * * @param cidrAddress the network to match * @return the new rule */ public final MatchRule matchNetwork(CidrAddress cidrAddress) { if (cidrAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, cidrAddress); } }
/** * Create a new rule which is the same as this rule, but also matches the given Internet address. * * @param inetAddress the address to match * @return the new rule */ public final MatchRule matchAddress(InetAddress inetAddress) { if (inetAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } }
/** * Create a new rule which is the same as this rule, but also matches the given host name. If the given string * appears to be an IP address or a CIDR network specification, then it is treated as such. * * @param hostSpec the host name to match * @return the new rule */ public final MatchRule matchHost(String hostSpec) { if (hostSpec == null || hostSpec.equals("*")) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } final CidrAddress cidrAddress = Inet.parseCidrAddress(hostSpec); if (cidrAddress != null) { return new MatchNetworkRule(this, cidrAddress); } final InetAddress inetAddress = Inet.parseInetAddress(hostSpec); if (inetAddress != null) { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } return new MatchHostRule(this, hostSpec); }
@Override MatchRule reparent(final MatchRule newParent) { return new MatchNetworkRule(newParent, cidrAddress); }
@Override MatchRule reparent(final MatchRule newParent) { return new MatchNetworkRule(newParent, cidrAddress); }
@Override MatchRule reparent(final MatchRule newParent) { return new MatchNetworkRule(newParent, cidrAddress); }
/** * Create a new rule which is the same as this rule, but also matches the given Internet network address. * * @param cidrAddress the network to match * @return the new rule */ public final MatchRule matchNetwork(CidrAddress cidrAddress) { if (cidrAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, cidrAddress); } }
/** * Create a new rule which is the same as this rule, but also matches the given Internet network address. * * @param cidrAddress the network to match * @return the new rule */ public final MatchRule matchNetwork(CidrAddress cidrAddress) { if (cidrAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, cidrAddress); } }
/** * Create a new rule which is the same as this rule, but also matches the given Internet network address. * * @param cidrAddress the network to match * @return the new rule */ public final MatchRule matchNetwork(CidrAddress cidrAddress) { if (cidrAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, cidrAddress); } }
/** * Create a new rule which is the same as this rule, but also matches the given Internet address. * * @param inetAddress the address to match * @return the new rule */ public final MatchRule matchAddress(InetAddress inetAddress) { if (inetAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } }
/** * Create a new rule which is the same as this rule, but also matches the given Internet address. * * @param inetAddress the address to match * @return the new rule */ public final MatchRule matchAddress(InetAddress inetAddress) { if (inetAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } }
/** * Create a new rule which is the same as this rule, but also matches the given Internet address. * * @param inetAddress the address to match * @return the new rule */ public final MatchRule matchAddress(InetAddress inetAddress) { if (inetAddress == null) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } else { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } }
/** * Create a new rule which is the same as this rule, but also matches the given host name. If the given string * appears to be an IP address or a CIDR network specification, then it is treated as such. * * @param hostSpec the host name to match * @return the new rule */ public final MatchRule matchHost(String hostSpec) { if (hostSpec == null || hostSpec.equals("*")) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } final CidrAddress cidrAddress = Inet.parseCidrAddress(hostSpec); if (cidrAddress != null) { return new MatchNetworkRule(this, cidrAddress); } final InetAddress inetAddress = Inet.parseInetAddress(hostSpec); if (inetAddress != null) { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } return new MatchHostRule(this, hostSpec); }
/** * Create a new rule which is the same as this rule, but also matches the given host name. If the given string * appears to be an IP address or a CIDR network specification, then it is treated as such. * * @param hostSpec the host name to match * @return the new rule */ public final MatchRule matchHost(String hostSpec) { if (hostSpec == null || hostSpec.equals("*")) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } final CidrAddress cidrAddress = Inet.parseCidrAddress(hostSpec); if (cidrAddress != null) { return new MatchNetworkRule(this, cidrAddress); } final InetAddress inetAddress = Inet.parseInetAddress(hostSpec); if (inetAddress != null) { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } return new MatchHostRule(this, hostSpec); }
/** * Create a new rule which is the same as this rule, but also matches the given host name. If the given string * appears to be an IP address or a CIDR network specification, then it is treated as such. * * @param hostSpec the host name to match * @return the new rule */ public final MatchRule matchHost(String hostSpec) { if (hostSpec == null || hostSpec.equals("*")) { return without(MatchHostRule.class).without(MatchNetworkRule.class); } final CidrAddress cidrAddress = Inet.parseCidrAddress(hostSpec); if (cidrAddress != null) { return new MatchNetworkRule(this, cidrAddress); } final InetAddress inetAddress = Inet.parseInetAddress(hostSpec); if (inetAddress != null) { return new MatchNetworkRule(this, CidrAddress.create(inetAddress, inetAddress instanceof Inet6Address ? 128 : 32)); } return new MatchHostRule(this, hostSpec); }