- @JsonProperty
- final String organization;
-
-
- public JsonSharedContact(SharedContact contact) {
- name = new JsonContactName(contact.getName());
- if (contact.getAvatar().isPresent()) {
- avatar = new JsonContactAvatar(contact.getAvatar().get());
- } else {
- avatar = null;
- }
-
- if (contact.getPhone().isPresent()) {
- phone = contact.getPhone()
- .get()
- .stream()
- .map(JsonContactPhone::new)
- .collect(Collectors.toList());
- } else {
- phone = null;
- }
-
- if (contact.getEmail().isPresent()) {
- email = contact.getEmail()
- .get()
- .stream()
- .map(JsonContactEmail::new)
- .collect(Collectors.toList());
- } else {
- email = null;
- }
-
- if (contact.getAddress().isPresent()) {
- address = contact.getAddress()
- .get()
- .stream()
- .map(JsonContactAddress::new)
- .collect(Collectors.toList());
- } else {
- address = null;
- }
-
- organization = contact.getOrganization().orNull();
+ return new JsonSharedContact(name, avatar, phone, email, address, organization);