Guest User

Untitled

a guest
May 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. ObjectMapper mapper = new ObjectMapper();
  2. mapper.registerModules(new JodaModule());
  3.  
  4. Book newBook = new Book();
  5. newBook.setCreationtime(new DateTime());
  6.  
  7. String convertedBook = null;
  8. try {
  9. convertedBook = mapper.writeValueAsString(newBook);
  10. } catch (JsonProcessingException e) {
  11. e.printStackTrace();
  12. }
Add Comment
Please, Sign In to add comment