Package org.mapstruct
Enum NullValueCheckStrategy
- All Implemented Interfaces:
Serializable,Comparable<NullValueCheckStrategy>,java.lang.constant.Constable
Strategy for dealing with null source values.
Note: This strategy is not in effect when a specific source presence check method is defined
in the service provider interface (SPI).
Note: some types of mappings (collections, maps), in which MapStruct is instructed to use a getter or adder
as target accessor see CollectionMappingStrategy, MapStruct will always generate a source property null
check, regardless the value of the NullValueCheckStrategy to avoid addition of null to the target
collection or map.
- Author:
- Sean Huang
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis option always includes a null check.This option includes a null check. -
Method Summary
Modifier and TypeMethodDescriptionstatic NullValueCheckStrategyReturns the enum constant of this type with the specified name.static NullValueCheckStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ON_IMPLICIT_CONVERSION
This option includes a null check. When:
- a source value is directly assigned to a target
- a source value assigned to a target by calling a type conversion on the target first
NOTE: mapping methods (generated or hand written) are excluded from this null check. They are intended to handle a null source value as 'valid' input. -
ALWAYS
This option always includes a null check.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-