Enum MappingControl.Use

java.lang.Object
java.lang.Enum<MappingControl.Use>
org.mapstruct.control.MappingControl.Use
All Implemented Interfaces:
Serializable, Comparable<MappingControl.Use>, java.lang.constant.Constable
Enclosing class:
MappingControl

public static enum MappingControl.Use extends Enum<MappingControl.Use>
Defines the options that can be used for the mapping control.
  • Enum Constant Details

    • BUILT_IN_CONVERSION

      public static final MappingControl.Use BUILT_IN_CONVERSION
      Controls the mapping, allows for type conversion from source type to target type

      Type conversions are typically supported directly in Java. The "toString()" is such an example, which allows for mapping for instance a Number type to a String.

      Please refer to the MapStruct guide for more info.

      Since:
      1.4
    • COMPLEX_MAPPING

      public static final MappingControl.Use COMPLEX_MAPPING
      Controls the mapping from source to target type, allows mapping by calling:
      1. A type conversion, passed into a mapping method
      2. A mapping method, passed into a type conversion
      3. A mapping method passed into another mapping method
      Since:
      1.4
    • DIRECT

      public static final MappingControl.Use DIRECT
      Controls the mapping, allows for a direct mapping from source type to target type.

      This means if source type and target type are of the same type, MapStruct will not perform any mappings anymore and assign the target to the source direct.

      An exception are types from the package java, which will be mapped always directly.

      Since:
      1.4
    • MAPPING_METHOD

      public static final MappingControl.Use MAPPING_METHOD
      Controls the mapping, allows for Direct Mapping from source type to target type.

      The mapping method can be either a custom referred mapping method, or a MapStruct built in mapping method.

      Since:
      1.4
  • Method Details

    • values

      public static MappingControl.Use[] 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

      public static MappingControl.Use valueOf(String name)
      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 name
      NullPointerException - if the argument is null