Created
December 13, 2018 13:48
-
-
Save eldermoraes/72af8cfb5c64f5d4c345427617b019cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private JsonObject asJsonObject(Book book, URI bookUri, | |
URI authorUri) { | |
return Json.createObjectBuilder() | |
.add("isbn", book.isbn) | |
.add("title", book.title) | |
.add("_links", Json.createObjectBuilder() | |
.add("self", Json.createObjectBuilder() | |
.add("href", bookUri.toString())) | |
.add("author", Json.createObjectBuilder() | |
.add("href", | |
authorUri.toString()))) | |
.build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment