@Test public void testContainsIpAddressIPv4() { Ip4Prefix ipPrefix; ipPrefix = Ip4Prefix.valueOf("1.2.0.0/24"); assertTrue(ipPrefix.contains(Ip4Address.valueOf("1.2.0.0"))); assertTrue(ipPrefix.contains(Ip4Address.valueOf("1.2.0.4"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("1.3.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("0.0.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("255.255.255.255"))); ipPrefix = Ip4Prefix.valueOf("1.2.0.0/32"); assertTrue(ipPrefix.contains(Ip4Address.valueOf("1.2.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("1.2.0.4"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("1.3.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("0.0.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("255.255.255.255"))); ipPrefix = Ip4Prefix.valueOf("0.0.0.0/0"); assertTrue(ipPrefix.contains(Ip4Address.valueOf("1.2.0.0"))); assertTrue(ipPrefix.contains(Ip4Address.valueOf("1.2.0.4"))); assertTrue(ipPrefix.contains(Ip4Address.valueOf("1.3.0.0"))); assertTrue(ipPrefix.contains(Ip4Address.valueOf("0.0.0.0"))); assertTrue(ipPrefix.contains(Ip4Address.valueOf("255.255.255.255"))); ipPrefix = Ip4Prefix.valueOf("255.255.255.255/32"); assertFalse(ipPrefix.contains(Ip4Address.valueOf("1.2.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("1.2.0.4"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("1.3.0.0"))); assertFalse(ipPrefix.contains(Ip4Address.valueOf("0.0.0.0"))); assertTrue(ipPrefix.contains(Ip4Address.valueOf("255.255.255.255"))); }
public static Ip4Prefix valueOf(int address, int prefixLength) { return new Ip4Prefix(Ip4Address.valueOf(address), prefixLength); }
Ip4Prefix extends IpPrefix { public static Ip4Prefix valueOf(int address, int prefixLength) { return new Ip4Prefix(Ip4Address.valueOf(address), prefixLength); } }
Ip4Prefix extends IpPrefix { public static Ip4Prefix valueOf(int address, int prefixLength) { return new Ip4Prefix(Ip4Address.valueOf(address), prefixLength); } private  Ip4Prefix(Ip4Address address, int prefixLength); }
Ip4Prefix extends IpPrefix { public static Ip4Prefix valueOf(int address, int prefixLength) { return new Ip4Prefix(Ip4Address.valueOf(address), prefixLength); } private  Ip4Prefix(Ip4Address address, int prefixLength); Ip4Address address(); static Ip4Prefix valueOf(int address, int prefixLength); static Ip4Prefix valueOf(byte[] address, int prefixLength); static Ip4Prefix valueOf(Ip4Address address, int prefixLength); static Ip4Prefix valueOf(String address); }
Ip4Prefix extends IpPrefix { public static Ip4Prefix valueOf(int address, int prefixLength) { return new Ip4Prefix(Ip4Address.valueOf(address), prefixLength); } private  Ip4Prefix(Ip4Address address, int prefixLength); Ip4Address address(); static Ip4Prefix valueOf(int address, int prefixLength); static Ip4Prefix valueOf(byte[] address, int prefixLength); static Ip4Prefix valueOf(Ip4Address address, int prefixLength); static Ip4Prefix valueOf(String address); static final IpAddress.Version VERSION; static final int MAX_MASK_LENGTH; }