Class ExistingInstanceSetterWrapperForCollectionsAndMaps

  • All Implemented Interfaces:
    Assignment, Writable

    public class ExistingInstanceSetterWrapperForCollectionsAndMaps
    extends SetterWrapperForCollectionsAndMapsWithNullCheck
    This wrapper handles the situation where an assignment is done for an update method. In case of a pre-existing target the wrapper checks if there is an collection or map initialized on the target bean (not null). If so it uses the addAll (for collections) or putAll (for maps). The collection / map is cleared in case of a pre-existing target MappingTargetbefore adding the source entries. If there is no pre-existing target, or the target Collection / Map is not initialized (null) the setter is used to create a new Collection / Map with the copy constructor.
    Author:
    Sjaak Derksen
    • Constructor Detail

      • ExistingInstanceSetterWrapperForCollectionsAndMaps

        public ExistingInstanceSetterWrapperForCollectionsAndMaps​(Assignment decoratedAssignment,
                                                                  List<Type> thrownTypesToExclude,
                                                                  Type targetType,
                                                                  org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs,
                                                                  org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms,
                                                                  TypeFactory typeFactory,
                                                                  boolean fieldAssignment)
    • Method Detail

      • isIncludeElseBranch

        public boolean isIncludeElseBranch()
      • isMapNullToDefault

        public boolean isMapNullToDefault()