@Test public void testParsingInvalidIdNegativeType1() { _thrown.expect(IllegalArgumentException.class); parse("1.1.1.1:-1"); }
@Nonnull public static RouteDistinguisher parse(String value) { String[] arr = value.split(":"); checkArgument(arr.length == 2, "At most one occurrence of ':' is allowed. Input was %s", value); Integer asn1 = Ints.tryParse(arr[0]); if (asn1 != null && asn1 <= 0xFFFF) { return from(asn1, Long.parseUnsignedLong(arr[1])); } Long asn1Long = Longs.tryParse(arr[0]); if (asn1Long != null) { return from(asn1Long, Integer.parseUnsignedInt(arr[1])); } return from(Ip.parse(arr[0]), Integer.parseUnsignedInt(arr[1])); }
RouteDistinguisher implements Serializable, Comparable<RouteDistinguisher> { @Nonnull public static RouteDistinguisher parse(String value) { String[] arr = value.split(":"); checkArgument(arr.length == 2, "At most one occurrence of ':' is allowed. Input was %s", value); Integer asn1 = Ints.tryParse(arr[0]); if (asn1 != null && asn1 <= 0xFFFF) { return from(asn1, Long.parseUnsignedLong(arr[1])); } Long asn1Long = Longs.tryParse(arr[0]); if (asn1Long != null) { return from(asn1Long, Integer.parseUnsignedInt(arr[1])); } return from(Ip.parse(arr[0]), Integer.parseUnsignedInt(arr[1])); } }
RouteDistinguisher implements Serializable, Comparable<RouteDistinguisher> { @Nonnull public static RouteDistinguisher parse(String value) { String[] arr = value.split(":"); checkArgument(arr.length == 2, "At most one occurrence of ':' is allowed. Input was %s", value); Integer asn1 = Ints.tryParse(arr[0]); if (asn1 != null && asn1 <= 0xFFFF) { return from(asn1, Long.parseUnsignedLong(arr[1])); } Long asn1Long = Longs.tryParse(arr[0]); if (asn1Long != null) { return from(asn1Long, Integer.parseUnsignedInt(arr[1])); } return from(Ip.parse(arr[0]), Integer.parseUnsignedInt(arr[1])); } private  RouteDistinguisher(long value, Type type); }
RouteDistinguisher implements Serializable, Comparable<RouteDistinguisher> { @Nonnull public static RouteDistinguisher parse(String value) { String[] arr = value.split(":"); checkArgument(arr.length == 2, "At most one occurrence of ':' is allowed. Input was %s", value); Integer asn1 = Ints.tryParse(arr[0]); if (asn1 != null && asn1 <= 0xFFFF) { return from(asn1, Long.parseUnsignedLong(arr[1])); } Long asn1Long = Longs.tryParse(arr[0]); if (asn1Long != null) { return from(asn1Long, Integer.parseUnsignedInt(arr[1])); } return from(Ip.parse(arr[0]), Integer.parseUnsignedInt(arr[1])); } private  RouteDistinguisher(long value, Type type); @Nonnull static RouteDistinguisher parse(String value); @Nonnull static RouteDistinguisher from(int asn1, long asn2); @Nonnull static RouteDistinguisher from(Ip ip, int asn); @Nonnull static RouteDistinguisher from(long asn1, int asn2); @Nonnull static RouteDistinguisher from(long asn1, long asn2); long getValue(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(RouteDistinguisher o); @Override @Nonnull @JsonValue String toString(); }
RouteDistinguisher implements Serializable, Comparable<RouteDistinguisher> { @Nonnull public static RouteDistinguisher parse(String value) { String[] arr = value.split(":"); checkArgument(arr.length == 2, "At most one occurrence of ':' is allowed. Input was %s", value); Integer asn1 = Ints.tryParse(arr[0]); if (asn1 != null && asn1 <= 0xFFFF) { return from(asn1, Long.parseUnsignedLong(arr[1])); } Long asn1Long = Longs.tryParse(arr[0]); if (asn1Long != null) { return from(asn1Long, Integer.parseUnsignedInt(arr[1])); } return from(Ip.parse(arr[0]), Integer.parseUnsignedInt(arr[1])); } private  RouteDistinguisher(long value, Type type); @Nonnull static RouteDistinguisher parse(String value); @Nonnull static RouteDistinguisher from(int asn1, long asn2); @Nonnull static RouteDistinguisher from(Ip ip, int asn); @Nonnull static RouteDistinguisher from(long asn1, int asn2); @Nonnull static RouteDistinguisher from(long asn1, long asn2); long getValue(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(RouteDistinguisher o); @Override @Nonnull @JsonValue String toString();  }