@Test public void test_toJson() throws RdapClientException { DomainDto domain = new DomainDto(); domain.setHandle("handle1"); RemarkDto remark = new RemarkDto(); ArrayList<String> description = new ArrayList<String>(); description.add("description1"); description.add("description2"); remark.setDescription(description); ArrayList<RemarkDto> remarks = new ArrayList<RemarkDto>(); remarks.add(remark); SecureDnsDto dns = new SecureDnsDto(); dns.setHandle("dns-handle1"); dns.setRemarks(remarks); domain.setSecureDNS(dns); assertEquals(json, JsonUtil.toJson(domain)); }
public static String toJson(Object object) throws RdapClientException { try { return objectMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new RdapClientException(makeMessage( ExceptionMessage.OBJECT_TO_JSON_ERROR, e)); } }
JsonUtil { public static String toJson(Object object) throws RdapClientException { try { return objectMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new RdapClientException(makeMessage( ExceptionMessage.OBJECT_TO_JSON_ERROR, e)); } } }
JsonUtil { public static String toJson(Object object) throws RdapClientException { try { return objectMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new RdapClientException(makeMessage( ExceptionMessage.OBJECT_TO_JSON_ERROR, e)); } } private  JsonUtil(); }
JsonUtil { public static String toJson(Object object) throws RdapClientException { try { return objectMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new RdapClientException(makeMessage( ExceptionMessage.OBJECT_TO_JSON_ERROR, e)); } } private  JsonUtil(); static String toJson(Object object); static T toObject(String json, Class<T> objectType); static T toObject(String json, Class<T> objectType,
            Map<String, String> unknownPropertiesMap); }
JsonUtil { public static String toJson(Object object) throws RdapClientException { try { return objectMapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new RdapClientException(makeMessage( ExceptionMessage.OBJECT_TO_JSON_ERROR, e)); } } private  JsonUtil(); static String toJson(Object object); static T toObject(String json, Class<T> objectType); static T toObject(String json, Class<T> objectType,
            Map<String, String> unknownPropertiesMap);  }