@Test public void toObject_null() { Map<String, Object> properties = new HashMap<>(); properties.put("address", null); final Person object = mapper.toObject(properties); final Person person = new Person(); ASSERT.that(person).isEqualTo(object); }
@Override public Person toObject(Map<String, Object> properties) { final Person object = new Person(); if (properties.get("address") != null) { object.address = addressMapper.toObject((Map<String, Object>) properties.get("address")); } else if (!properties.containsKey("address")) { throw new IllegalStateException("The property \"address\" is not set."); } else { object.address = null; } return object; }
Person implements Mapper<Person> { @Override public Person toObject(Map<String, Object> properties) { final Person object = new Person(); if (properties.get("address") != null) { object.address = addressMapper.toObject((Map<String, Object>) properties.get("address")); } else if (!properties.containsKey("address")) { throw new IllegalStateException("The property \"address\" is not set."); } else { object.address = null; } return object; } }
Person implements Mapper<Person> { @Override public Person toObject(Map<String, Object> properties) { final Person object = new Person(); if (properties.get("address") != null) { object.address = addressMapper.toObject((Map<String, Object>) properties.get("address")); } else if (!properties.containsKey("address")) { throw new IllegalStateException("The property \"address\" is not set."); } else { object.address = null; } return object; }  }
Person implements Mapper<Person> { @Override public Person toObject(Map<String, Object> properties) { final Person object = new Person(); if (properties.get("address") != null) { object.address = addressMapper.toObject((Map<String, Object>) properties.get("address")); } else if (!properties.containsKey("address")) { throw new IllegalStateException("The property \"address\" is not set."); } else { object.address = null; } return object; }  @Override Person toObject(Map<String, Object> properties); @Override Map<String, Object> toProperties(Person object); }
Person implements Mapper<Person> { @Override public Person toObject(Map<String, Object> properties) { final Person object = new Person(); if (properties.get("address") != null) { object.address = addressMapper.toObject((Map<String, Object>) properties.get("address")); } else if (!properties.containsKey("address")) { throw new IllegalStateException("The property \"address\" is not set."); } else { object.address = null; } return object; }  @Override Person toObject(Map<String, Object> properties); @Override Map<String, Object> toProperties(Person object); public Address addressMapper; }