playbee
playbee
For example (one abstract class and two concrete classes): ``` public abstract class Animal { private String name; ... } public class Cat extends Animal { private Boolean mouseCatcher; ......
Possible values for ignoreStrategy: 1) ALWAYS (as true) 2) NEVER (as false) 3) NULL_SOURCE (ignore if source value is null) - often required in many projects ``` if (source.getValue() !=...
For example, ``` @Mapping( target = "timeAndFormat", expression = "java( new org.sample.TimeAndFormat( #source.getTime(), #target.getFormat() ) )" ) Target sourceToTarget(Source s); ``` And replace #source and #target to correct values at...
With mapper configuration: ``` @MapperConfig( componentModel = "spring", nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT ) public class MapperConfiguration { } ``` and mapper: ``` @Mapper(config = MapperConfiguration.class) public interface ConvertObjectMapper { @Mapping(target =...