@Test public void testToString() { assertThat(IpWildcard.parse("1.2.3.4").toString(), equalTo("1.2.3.4")); assertThat(IpWildcard.parse("1.2.3.4/0").toString(), equalTo("0.0.0.0/0")); assertThat(IpWildcard.parse("1.2.3.4/8").toString(), equalTo("1.0.0.0/8")); assertThat(IpWildcard.parse("1.2.3.4/31").toString(), equalTo("1.2.3.4/31")); assertThat(IpWildcard.parse("1.2.3.4/32").toString(), equalTo("1.2.3.4")); assertThat(IpWildcard.parse("1.2.3.4:255.0.255.0").toString(), equalTo("0.2.0.4:255.0.255.0")); }
@JsonValue @Override public String toString() { if (_wildcardMask == 0L) { return _ip.toString(); } else if (isPrefix()) { return toPrefix().toString(); } else { return _ip + ":" + getWildcardMaskAsIp(); } }
IpWildcard implements Serializable, Comparable<IpWildcard> { @JsonValue @Override public String toString() { if (_wildcardMask == 0L) { return _ip.toString(); } else if (isPrefix()) { return toPrefix().toString(); } else { return _ip + ":" + getWildcardMaskAsIp(); } } }
IpWildcard implements Serializable, Comparable<IpWildcard> { @JsonValue @Override public String toString() { if (_wildcardMask == 0L) { return _ip.toString(); } else if (isPrefix()) { return toPrefix().toString(); } else { return _ip + ":" + getWildcardMaskAsIp(); } } private  IpWildcard(Ip address, long wildcardMask); }
IpWildcard implements Serializable, Comparable<IpWildcard> { @JsonValue @Override public String toString() { if (_wildcardMask == 0L) { return _ip.toString(); } else if (isPrefix()) { return toPrefix().toString(); } else { return _ip + ":" + getWildcardMaskAsIp(); } } private  IpWildcard(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, Ip wildcardMask); static IpWildcard create(Prefix prefix); static IpWildcard create(Ip ip); @JsonCreator static IpWildcard parse(String str); boolean containsIp(Ip ip); @Override int compareTo(IpWildcard o); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Nonnull Ip getIp(); @Nonnull Ip getWildcardMaskAsIp(); long getWildcardMask(); long getMask(); boolean intersects(IpWildcard other); boolean isPrefix(); boolean subsetOf(IpWildcard other); boolean supersetOf(IpWildcard other); @Nonnull IpWildcardIpSpace toIpSpace(); Prefix toPrefix(); @JsonValue @Override String toString(); }
IpWildcard implements Serializable, Comparable<IpWildcard> { @JsonValue @Override public String toString() { if (_wildcardMask == 0L) { return _ip.toString(); } else if (isPrefix()) { return toPrefix().toString(); } else { return _ip + ":" + getWildcardMaskAsIp(); } } private  IpWildcard(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, Ip wildcardMask); static IpWildcard create(Prefix prefix); static IpWildcard create(Ip ip); @JsonCreator static IpWildcard parse(String str); boolean containsIp(Ip ip); @Override int compareTo(IpWildcard o); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Nonnull Ip getIp(); @Nonnull Ip getWildcardMaskAsIp(); long getWildcardMask(); long getMask(); boolean intersects(IpWildcard other); boolean isPrefix(); boolean subsetOf(IpWildcard other); boolean supersetOf(IpWildcard other); @Nonnull IpWildcardIpSpace toIpSpace(); Prefix toPrefix(); @JsonValue @Override String toString(); static final IpWildcard ANY; }