@Override public void write(JSONStringer writer) throws JSONException { super.write(writer); writeProperties(writer, getProperties()); }
@Test public void compare() { /* Empty objects. */ CustomPropertiesLog a = new CustomPropertiesLog(); CustomPropertiesLog b = new CustomPropertiesLog(); checkEquals(a, b); checkEquals(a.getType(), CustomPropertiesLog.TYPE); UUID sid = UUIDUtils.randomUUID(); a.setSid(sid); checkNotEquals(a, b); b.setSid(sid); checkEquals(a, b); /* Properties. */ Map<String, Object> properties = new HashMap<>(); properties.put("test", "test"); a.setProperties(properties); checkEquals(a.getProperties(), properties); checkNotEquals(a, b); b.setProperties(new HashMap<String, Object>()); checkNotEquals(a, b); b.setProperties(properties); checkEquals(a, b); } }