@Test public void toJSONSkipsUnknownInformation() { AuditEvent e = new AuditEvent(null, null, null, null, null, null); JSONObject result = e.toJSON(); Assert.assertEquals(0, result.length()); }
public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getId()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.toString()); event.put("time", this.time == null ? null : this.time.toInstant().toString()); return event; }
AuditEvent { public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getId()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.toString()); event.put("time", this.time == null ? null : this.time.toInstant().toString()); return event; } }
AuditEvent { public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getId()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.toString()); event.put("time", this.time == null ? null : this.time.toInstant().toString()); return event; } AuditEvent();  AuditEvent(final User user, final String ip,
        final String action, final String extra,
        final DocumentReference entity,
        final Calendar time); }
AuditEvent { public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getId()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.toString()); event.put("time", this.time == null ? null : this.time.toInstant().toString()); return event; } AuditEvent();  AuditEvent(final User user, final String ip,
        final String action, final String extra,
        final DocumentReference entity,
        final Calendar time); @Nullable User getUser(); @Nullable String getIp(); @Nonnull String getAction(); @Nullable String getExtraInformation(); @Nullable DocumentReference getEntity(); @Nonnull Calendar getTime(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); JSONObject toJSON(); }
AuditEvent { public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getId()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.toString()); event.put("time", this.time == null ? null : this.time.toInstant().toString()); return event; } AuditEvent();  AuditEvent(final User user, final String ip,
        final String action, final String extra,
        final DocumentReference entity,
        final Calendar time); @Nullable User getUser(); @Nullable String getIp(); @Nonnull String getAction(); @Nullable String getExtraInformation(); @Nullable DocumentReference getEntity(); @Nonnull Calendar getTime(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); JSONObject toJSON();  }