Created
October 14, 2021 00:53
-
-
Save Marlysson/9e91cc74945d065ce373bb6a79253862 to your computer and use it in GitHub Desktop.
Herança?
This file contains hidden or 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
public String toJson() throws JsonProcessingException { | |
ObjectMapper mapper = new ObjectMapper(); | |
return mapper.writeValueAsString(this); | |
} | |
public PessoaFisica toModel() { | |
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); | |
ObjectMapper mapper = new ObjectMapper(); | |
mapper.setDateFormat(df); | |
return mapper.convertValue(this, OBJ.class); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment