Created
April 2, 2022 11:56
-
-
Save Gogetter/1195f87c5f75c9d299c1ee97b0ace9d2 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
@JsonIgnoreProperties(ignoreUnknown = true) | |
public record Person( | |
@JsonProperty("gender") String gender, | |
@JsonProperty("name") Name fullName, | |
@JsonProperty("email") String email) { | |
public static Person from(Map<String, Object> personMap) { | |
return new ObjectMapper().convertValue(personMap, Person.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment