@Test public void testParseInvalidTooLong() { _thrown.expect(IllegalArgumentException.class); parse("00:11:22:33:44:55:66"); }
public static @Nonnull MacAddress parse(String macAddressStr) { checkArgument(PATTERN.matcher(macAddressStr).matches(), "Not a MAC address: %s", macAddressStr); String hexDigits = macAddressStr.replace(":", ""); return new MacAddress(Long.parseLong(hexDigits, 16)); }
MacAddress implements Comparable<MacAddress>, Serializable { public static @Nonnull MacAddress parse(String macAddressStr) { checkArgument(PATTERN.matcher(macAddressStr).matches(), "Not a MAC address: %s", macAddressStr); String hexDigits = macAddressStr.replace(":", ""); return new MacAddress(Long.parseLong(hexDigits, 16)); } }
MacAddress implements Comparable<MacAddress>, Serializable { public static @Nonnull MacAddress parse(String macAddressStr) { checkArgument(PATTERN.matcher(macAddressStr).matches(), "Not a MAC address: %s", macAddressStr); String hexDigits = macAddressStr.replace(":", ""); return new MacAddress(Long.parseLong(hexDigits, 16)); } private  MacAddress(long longVal); }
MacAddress implements Comparable<MacAddress>, Serializable { public static @Nonnull MacAddress parse(String macAddressStr) { checkArgument(PATTERN.matcher(macAddressStr).matches(), "Not a MAC address: %s", macAddressStr); String hexDigits = macAddressStr.replace(":", ""); return new MacAddress(Long.parseLong(hexDigits, 16)); } private  MacAddress(long longVal); static @Nonnull MacAddress of(long longVal); static @Nonnull MacAddress parse(String macAddressStr); long asLong(); @Override int compareTo(MacAddress o); @Override boolean equals(Object obj); @Override int hashCode(); @JsonValue @Override @Nonnull String toString(); }
MacAddress implements Comparable<MacAddress>, Serializable { public static @Nonnull MacAddress parse(String macAddressStr) { checkArgument(PATTERN.matcher(macAddressStr).matches(), "Not a MAC address: %s", macAddressStr); String hexDigits = macAddressStr.replace(":", ""); return new MacAddress(Long.parseLong(hexDigits, 16)); } private  MacAddress(long longVal); static @Nonnull MacAddress of(long longVal); static @Nonnull MacAddress parse(String macAddressStr); long asLong(); @Override int compareTo(MacAddress o); @Override boolean equals(Object obj); @Override int hashCode(); @JsonValue @Override @Nonnull String toString();  }