LogHolder.java 579 B

123456789101112131415161718192021222324
  1. package at.acdp.urweb.sclient.data;
  2. import com.eclipsesource.json.JsonObject;
  3. public class LogHolder implements IJsonObject{
  4. public long timestamp;
  5. public IJsonObject entry;
  6. public String type;
  7. public LogHolder(String type, IJsonObject entry) {
  8. this.entry=entry;
  9. this.timestamp=System.currentTimeMillis();
  10. this.type=type;
  11. }
  12. @Override
  13. public JsonObject toJSON() {
  14. return new JsonObject()
  15. .add("type", type)
  16. .add("ts", timestamp)
  17. .add("entry", entry.toJSON());
  18. }
  19. }