@Test public void testToString() { PrefixRange pr = PrefixRange.fromString("1.2.3.4/8:17-19"); assertThat(pr.toString(), equalTo("1.0.0.0/8:17-19")); }
@Override @JsonValue public String toString() { int prefixLength = _prefix.getPrefixLength(); int low = _lengthRange.getStart(); int high = _lengthRange.getEnd(); if (prefixLength == low && prefixLength == high) { return _prefix.toString(); } else { return _prefix + ":" + low + "-" + high; } }
PrefixRange implements Serializable, Comparable<PrefixRange> { @Override @JsonValue public String toString() { int prefixLength = _prefix.getPrefixLength(); int low = _lengthRange.getStart(); int high = _lengthRange.getEnd(); if (prefixLength == low && prefixLength == high) { return _prefix.toString(); } else { return _prefix + ":" + low + "-" + high; } } }
PrefixRange implements Serializable, Comparable<PrefixRange> { @Override @JsonValue public String toString() { int prefixLength = _prefix.getPrefixLength(); int low = _lengthRange.getStart(); int high = _lengthRange.getEnd(); if (prefixLength == low && prefixLength == high) { return _prefix.toString(); } else { return _prefix + ":" + low + "-" + high; } } PrefixRange(Prefix prefix, SubRange lengthRange); }
PrefixRange implements Serializable, Comparable<PrefixRange> { @Override @JsonValue public String toString() { int prefixLength = _prefix.getPrefixLength(); int low = _lengthRange.getStart(); int high = _lengthRange.getEnd(); if (prefixLength == low && prefixLength == high) { return _prefix.toString(); } else { return _prefix + ":" + low + "-" + high; } } PrefixRange(Prefix prefix, SubRange lengthRange); static PrefixRange fromPrefix(Prefix prefix); @JsonCreator static PrefixRange fromString(String prefixRangeStr); static PrefixRange moreSpecificThan(Prefix prefix); SubRange getLengthRange(); Prefix getPrefix(); boolean includesPrefixRange(PrefixRange argPrefixRange); @Override @JsonValue String toString(); @Override int compareTo(@Nonnull PrefixRange o); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); }
PrefixRange implements Serializable, Comparable<PrefixRange> { @Override @JsonValue public String toString() { int prefixLength = _prefix.getPrefixLength(); int low = _lengthRange.getStart(); int high = _lengthRange.getEnd(); if (prefixLength == low && prefixLength == high) { return _prefix.toString(); } else { return _prefix + ":" + low + "-" + high; } } PrefixRange(Prefix prefix, SubRange lengthRange); static PrefixRange fromPrefix(Prefix prefix); @JsonCreator static PrefixRange fromString(String prefixRangeStr); static PrefixRange moreSpecificThan(Prefix prefix); SubRange getLengthRange(); Prefix getPrefix(); boolean includesPrefixRange(PrefixRange argPrefixRange); @Override @JsonValue String toString(); @Override int compareTo(@Nonnull PrefixRange o); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); static final PrefixRange ALL; }