@Test public void testStrictNonCanonical() { String nonCanonical = "1.2.0.0/8"; _thrown.expect(IllegalArgumentException.class); strict(nonCanonical); }
public static @Nonnull Prefix strict(String prefixStr) { Prefix prefix = parse(prefixStr); checkArgument(prefix.toString().equals(prefixStr), "Non-canonical prefix: %s", prefixStr); return prefix; }
Prefix implements Comparable<Prefix>, Serializable { public static @Nonnull Prefix strict(String prefixStr) { Prefix prefix = parse(prefixStr); checkArgument(prefix.toString().equals(prefixStr), "Non-canonical prefix: %s", prefixStr); return prefix; } }
Prefix implements Comparable<Prefix>, Serializable { public static @Nonnull Prefix strict(String prefixStr) { Prefix prefix = parse(prefixStr); checkArgument(prefix.toString().equals(prefixStr), "Non-canonical prefix: %s", prefixStr); return prefix; } private  Prefix(Ip ip, int prefixLength); }
Prefix implements Comparable<Prefix>, Serializable { public static @Nonnull Prefix strict(String prefixStr) { Prefix prefix = parse(prefixStr); checkArgument(prefix.toString().equals(prefixStr), "Non-canonical prefix: %s", prefixStr); return prefix; } private  Prefix(Ip ip, int prefixLength); @Nonnull @JsonCreator static Prefix parse(@Nullable String text); @Nonnull static Optional<Prefix> tryParse(@Nonnull String text); static @Nonnull Prefix strict(String prefixStr); static Prefix create(Ip ip, int prefixLength); static Prefix create(Ip address, Ip mask); static Prefix longestCommonPrefix(Prefix p1, Prefix p2); @Override int compareTo(Prefix rhs); boolean containsIp(Ip ip); boolean containsPrefix(Prefix prefix); @Override boolean equals(@Nullable Object o); @Nonnull Ip getEndIp(); int getPrefixLength(); @Nonnull Ip getPrefixWildcard(); @Nonnull Ip getStartIp(); @Override int hashCode(); @Nonnull IpSpace toIpSpace(); IpSpace toHostIpSpace(); Ip getFirstHostIp(); Ip getLastHostIp(); @Override @JsonValue String toString(); }
Prefix implements Comparable<Prefix>, Serializable { public static @Nonnull Prefix strict(String prefixStr) { Prefix prefix = parse(prefixStr); checkArgument(prefix.toString().equals(prefixStr), "Non-canonical prefix: %s", prefixStr); return prefix; } private  Prefix(Ip ip, int prefixLength); @Nonnull @JsonCreator static Prefix parse(@Nullable String text); @Nonnull static Optional<Prefix> tryParse(@Nonnull String text); static @Nonnull Prefix strict(String prefixStr); static Prefix create(Ip ip, int prefixLength); static Prefix create(Ip address, Ip mask); static Prefix longestCommonPrefix(Prefix p1, Prefix p2); @Override int compareTo(Prefix rhs); boolean containsIp(Ip ip); boolean containsPrefix(Prefix prefix); @Override boolean equals(@Nullable Object o); @Nonnull Ip getEndIp(); int getPrefixLength(); @Nonnull Ip getPrefixWildcard(); @Nonnull Ip getStartIp(); @Override int hashCode(); @Nonnull IpSpace toIpSpace(); IpSpace toHostIpSpace(); Ip getFirstHostIp(); Ip getLastHostIp(); @Override @JsonValue String toString(); static final int MAX_PREFIX_LENGTH; static final Prefix ZERO; static final Prefix MULTICAST; static final int HOST_SUBNET_MAX_PREFIX_LENGTH; }