
public enum NullValueMappingStrategy extends Enum<NullValueMappingStrategy>
null values passed to mapping methods.| Enum Constant and Description |
|---|
RETURN_DEFAULT
If
null is passed to a mapping method, a default value will be returned. |
RETURN_NULL
If
null is passed to a mapping method, null will be returned. |
| Modifier and Type | Method and Description |
|---|---|
static NullValueMappingStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NullValueMappingStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NullValueMappingStrategy RETURN_NULL
null is passed to a mapping method, null will be returned. That's the default behavior if no
alternative strategy is configured globally, for given mapper or method.public static final NullValueMappingStrategy RETURN_DEFAULT
null is passed to a mapping method, a default value will be returned. The value depends on the kind of
the annotated method:
Mapping.expression() or Mapping.constant() will be populated based on the
given expression or constant. Note that expressions must be prepared to deal with null values in this
case.public static NullValueMappingStrategy[] values()
for (NullValueMappingStrategy c : NullValueMappingStrategy.values()) System.out.println(c);
public static NullValueMappingStrategy valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.