Skip to content

Instantly share code, notes, and snippets.

@Marlysson
Created October 14, 2021 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marlysson/9e91cc74945d065ce373bb6a79253862 to your computer and use it in GitHub Desktop.
Save Marlysson/9e91cc74945d065ce373bb6a79253862 to your computer and use it in GitHub Desktop.
Herança?
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