@Test public void testToJsonObject() { UUID uuid = UUID.randomUUID(); Instant instant = Instant.now(); JsonObject json = new FileMetadata(uuid, "name", MimeType.valueOf("text/plain"), 0, instant).toJsonObject(); assertThat(json.getString("id")).isEqualTo(uuid.toString()); assertThat(json.getString("name")).isEqualTo("name"); assertThat(json.getString("mime_type")).isEqualTo("text/plain"); assertThat(json.getInteger("content_length")).isEqualTo(0); assertThat(json.getInstant("generated")).isEqualTo(instant); }
public JsonObject toJsonObject() { return new JsonObject() .put("id", fileId.toString()) .put("name", name) .put("mime_type", mimeType.toString()) .put("content_length", contentLength) .put("generated", generated); }
FileMetadata implements Serializable { public JsonObject toJsonObject() { return new JsonObject() .put("id", fileId.toString()) .put("name", name) .put("mime_type", mimeType.toString()) .put("content_length", contentLength) .put("generated", generated); } }
FileMetadata implements Serializable { public JsonObject toJsonObject() { return new JsonObject() .put("id", fileId.toString()) .put("name", name) .put("mime_type", mimeType.toString()) .put("content_length", contentLength) .put("generated", generated); }  }
FileMetadata implements Serializable { public JsonObject toJsonObject() { return new JsonObject() .put("id", fileId.toString()) .put("name", name) .put("mime_type", mimeType.toString()) .put("content_length", contentLength) .put("generated", generated); }  JsonObject toJsonObject(); }
FileMetadata implements Serializable { public JsonObject toJsonObject() { return new JsonObject() .put("id", fileId.toString()) .put("name", name) .put("mime_type", mimeType.toString()) .put("content_length", contentLength) .put("generated", generated); }  JsonObject toJsonObject();  }