@Test public void testParse() { assertThat( ConcreteInterfaceAddress.parse("1.1.1.1/24"), equalTo(ConcreteInterfaceAddress.create(Ip.parse("1.1.1.1"), 24))); }
public static ConcreteInterfaceAddress parse(String text) { String[] parts = text.split("/"); checkArgument( parts.length == 2, "Invalid %s string: \"%s\"", ConcreteInterfaceAddress.class.getSimpleName(), text); Ip ip = Ip.parse(parts[0]); int networkBits = Integer.parseUnsignedInt(parts[1]); return create(ip, networkBits); }
ConcreteInterfaceAddress extends InterfaceAddress { public static ConcreteInterfaceAddress parse(String text) { String[] parts = text.split("/"); checkArgument( parts.length == 2, "Invalid %s string: \"%s\"", ConcreteInterfaceAddress.class.getSimpleName(), text); Ip ip = Ip.parse(parts[0]); int networkBits = Integer.parseUnsignedInt(parts[1]); return create(ip, networkBits); } }
ConcreteInterfaceAddress extends InterfaceAddress { public static ConcreteInterfaceAddress parse(String text) { String[] parts = text.split("/"); checkArgument( parts.length == 2, "Invalid %s string: \"%s\"", ConcreteInterfaceAddress.class.getSimpleName(), text); Ip ip = Ip.parse(parts[0]); int networkBits = Integer.parseUnsignedInt(parts[1]); return create(ip, networkBits); } private  ConcreteInterfaceAddress(Ip ip, int networkBits); }
ConcreteInterfaceAddress extends InterfaceAddress { public static ConcreteInterfaceAddress parse(String text) { String[] parts = text.split("/"); checkArgument( parts.length == 2, "Invalid %s string: \"%s\"", ConcreteInterfaceAddress.class.getSimpleName(), text); Ip ip = Ip.parse(parts[0]); int networkBits = Integer.parseUnsignedInt(parts[1]); return create(ip, networkBits); } private  ConcreteInterfaceAddress(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, Ip networkMask); static ConcreteInterfaceAddress parse(String text); @Override int compareTo(InterfaceAddress rhs); @Override boolean equals(@Nullable Object o); @Nonnull Ip getIp(); int getNetworkBits(); @Nonnull Prefix getPrefix(); @Override int hashCode(); @Override @JsonValue String toString(); }
ConcreteInterfaceAddress extends InterfaceAddress { public static ConcreteInterfaceAddress parse(String text) { String[] parts = text.split("/"); checkArgument( parts.length == 2, "Invalid %s string: \"%s\"", ConcreteInterfaceAddress.class.getSimpleName(), text); Ip ip = Ip.parse(parts[0]); int networkBits = Integer.parseUnsignedInt(parts[1]); return create(ip, networkBits); } private  ConcreteInterfaceAddress(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, int networkBits); static ConcreteInterfaceAddress create(Ip ip, Ip networkMask); static ConcreteInterfaceAddress parse(String text); @Override int compareTo(InterfaceAddress rhs); @Override boolean equals(@Nullable Object o); @Nonnull Ip getIp(); int getNetworkBits(); @Nonnull Prefix getPrefix(); @Override int hashCode(); @Override @JsonValue String toString();  }