1919
2020import com .fasterxml .jackson .annotation .JsonCreator ;
2121import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
22+ import com .fasterxml .jackson .annotation .JsonInclude ;
2223import com .fasterxml .jackson .annotation .JsonProperty ;
2324import com .fasterxml .jackson .annotation .JsonRootName ;
2425import org .slf4j .Logger ;
3536 *
3637 */
3738@ JsonRootName (value = "contact" )
39+ @ JsonIgnoreProperties (ignoreUnknown = true )
3840public class Contact {
41+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
42+ private final Long id ;
3943 private final String email ;
4044 private final String firstName ;
4145 private final String lastName ;
@@ -48,13 +52,14 @@ public static ContactBuilder newBuilder() {
4852
4953 @ JsonCreator
5054 public Contact (
55+ @ JsonProperty ("id" ) final Long id ,
5156 @ JsonProperty ("email" ) final String email ,
5257 @ JsonProperty ("firstName" ) final String firstName ,
5358 @ JsonProperty ("lastName" ) final String lastName ,
5459 @ JsonProperty ("phone" ) final String phone ,
5560 final List <FieldValue > fieldValues
5661 ) {
57-
62+ this . id = id ;
5863 this .email = email ;
5964 this .firstName = firstName ;
6065 this .lastName = lastName ;
@@ -89,7 +94,8 @@ public List<FieldValue> getFieldValues() {
8994 @ Override
9095 public String toString () {
9196 return "Contact{"
92- + "email='" + email + '\''
97+ + "id=" + id
98+ + ", email='" + email + '\''
9399 + ", firstName='" + firstName + '\''
94100 + ", lastName='" + lastName + '\''
95101 + ", phone='" + phone + '\''
0 commit comments