public enum CollectionMappingStrategy extends java.lang.Enum<CollectionMappingStrategy>
| Enum Constant and Description |
|---|
ACCESSOR_ONLY
The setter of the target property will be used to propagate the value:
orderDto.setOrderLines(order.getOrderLines). |
ADDER_PREFERRED
Identical to
SETTER_PREFERRED, only that adder methods will be preferred over setter methods, if both
are present for a given collection-typed property. |
DEFAULT
If given via
Mapper.collectionMappingStrategy(), causes the setting specified via
MapperConfig.collectionMappingStrategy() to be applied, if present. |
SETTER_PREFERRED
If present, the setter of the target property will be used to propagate the value:
orderDto.setOrderLines(order.getOrderLines). |
| Modifier and Type | Method and Description |
|---|---|
static CollectionMappingStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CollectionMappingStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CollectionMappingStrategy ACCESSOR_ONLY
orderDto.setOrderLines(order.getOrderLines).
If no setter is available but a getter method, this will be used, under the assumption it has been initialized:
orderDto.getOrderLines().addAll(order.getOrderLines).
public static final CollectionMappingStrategy SETTER_PREFERRED
orderDto.setOrderLines(order.getOrderLines).
If no setter but and adder method is present, that adder will be invoked for each element of the source
collection: order.addOrderLine(orderLine() ).
If neither a setter nor an adder method but a getter for the target property is present, that getter will be used, assuming it returns an initialized collection: If no setter is available, MapStruct will first look for an adder method before resorting to a getter.
public static final CollectionMappingStrategy ADDER_PREFERRED
SETTER_PREFERRED, only that adder methods will be preferred over setter methods, if both
are present for a given collection-typed property.public static final CollectionMappingStrategy DEFAULT
Mapper.collectionMappingStrategy(), causes the setting specified via
MapperConfig.collectionMappingStrategy() to be applied, if present. Otherwise causes
ACCESSOR_ONLY to be applied.public static CollectionMappingStrategy[] values()
for (CollectionMappingStrategy c : CollectionMappingStrategy.values()) System.out.println(c);
public static CollectionMappingStrategy valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullCopyright © 2012-2015. All Rights Reserved.