Identifier implements Serializable { public static Identifier dns(String domain) { return new Identifier(TYPE_DNS, toAce(domain)); } Identifier(String type, String value);  Identifier(JSON json); static Identifier dns(String domain); static Identifier ip(InetAddress ip); static Identifier ip(String ip); String getType(); String getValue(); String getDomain(); InetAddress getIP(); Map<String, Object> toMap(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); static final String TYPE_DNS; static final String TYPE_IP; }
@Test public void testDns() { Identifier id1 = Identifier.dns("example.com"); assertThat(id1.getType(), is(Identifier.TYPE_DNS)); assertThat(id1.getValue(), is("example.com")); assertThat(id1.getDomain(), is("example.com")); Identifier id2 = Identifier.dns("ëxämþlë.com"); assertThat(id2.getType(), is(Identifier.TYPE_DNS)); assertThat(id2.getValue(), is("xn--xml-qla7ae5k.com")); assertThat(id2.getDomain(), is("xn--xml-qla7ae5k.com")); }