@Test public void testValueOfByteArrayIPv4() { Ip4Prefix ipPrefix; byte[] value; value = new byte[] {1, 2, 3, 4}; ipPrefix = Ip4Prefix.valueOf(value, 24); assertThat(ipPrefix.toString(), is("1.2.3.0/24")); ipPrefix = Ip4Prefix.valueOf(value, 32); assertThat(ipPrefix.toString(), is("1.2.3.4/32")); value = new byte[] {1, 2, 3, 5}; ipPrefix = Ip4Prefix.valueOf(value, 32); assertThat(ipPrefix.toString(), is("1.2.3.5/32")); value = new byte[] {0, 0, 0, 0}; ipPrefix = Ip4Prefix.valueOf(value, 0); assertThat(ipPrefix.toString(), is("0.0.0.0/0")); ipPrefix = Ip4Prefix.valueOf(value, 32); assertThat(ipPrefix.toString(), is("0.0.0.0/32")); value = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}; ipPrefix = Ip4Prefix.valueOf(value, 0); assertThat(ipPrefix.toString(), is("0.0.0.0/0")); ipPrefix = Ip4Prefix.valueOf(value, 16); assertThat(ipPrefix.toString(), is("255.255.0.0/16")); ipPrefix = Ip4Prefix.valueOf(value, 32); assertThat(ipPrefix.toString(), is("255.255.255.255/32")); }
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; }