public static IPAddressPermission getIPAddressMask(String mask) { if (StartWithIPAddressPermission.canSupport(mask)) { return new StartWithIPAddressPermission(mask); } else if (ExactIPAddressPermission.canSupport(mask)) { return new ExactIPAddressPermission(mask); } else if (FactorizedIPAddressPermission.canSupport(mask)) { return new FactorizedIPAddressPermission(mask); } else if (NetmaskIPAddressPermission.canSupport(mask)) { return new NetmaskIPAddressPermission(mask); } else if (ExactIPv6AddressPermission.canSupport(mask)) { return new ExactIPv6AddressPermission(mask); } else if (NetmaskIPv6AddressPermission.canSupport(mask)) { return new NetmaskIPv6AddressPermission(mask); } throw new IllegalArgumentException("Mask " + mask + " is not supported."); } }
public static IPAddressPermission getIPAddressMask(String mask) { if (StartWithIPAddressPermission.canSupport(mask)) { return new StartWithIPAddressPermission(mask); } else if (ExactIPAddressPermission.canSupport(mask)) { return new ExactIPAddressPermission(mask); } else if (FactorizedIPAddressPermission.canSupport(mask)) { return new FactorizedIPAddressPermission(mask); } else if (NetmaskIPAddressPermission.canSupport(mask)) { return new NetmaskIPAddressPermission(mask); } else if (ExactIPv6AddressPermission.canSupport(mask)) { return new ExactIPv6AddressPermission(mask); } else if (NetmaskIPv6AddressPermission.canSupport(mask)) { return new NetmaskIPv6AddressPermission(mask); } throw new IllegalArgumentException("Mask " + mask + " is not supported."); } }