@JsonDeserialize(using = ContactsDeserializer.class)
private Map<String, ContactInfo> contacts = new HashMap<>();
- private static final ObjectMapper jsonProcessot = new ObjectMapper();
+ private static final ObjectMapper jsonProcessor = new ObjectMapper();
void updateContact(ContactInfo contact) {
contacts.put(contact.number, contact);
}
ContactInfo getContact(String number) {
- ContactInfo c = contacts.get(number);
- return c;
+ return contacts.get(number);
}
List<ContactInfo> getContacts() {
Map<String, ContactInfo> contacts = new HashMap<>();
JsonNode node = jsonParser.getCodec().readTree(jsonParser);
for (JsonNode n : node) {
- ContactInfo c = jsonProcessot.treeToValue(n, ContactInfo.class);
+ ContactInfo c = jsonProcessor.treeToValue(n, ContactInfo.class);
contacts.put(c.number, c);
}