Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1.     @Override
  2.     public LocalDate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
  3.  
  4.         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
  5.  
  6.         String data = p.getValueAsString();;
  7.         if (data.equals("")) return LocalDate.parse("01/01/0001", formatter);
  8.         else return LocalDate.parse(data, formatter);
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement