Enum DtoMapping.Setter
- All Implemented Interfaces:
Serializable, Comparable<DtoMapping.Setter>
- Enclosing class:
DtoMapping
DtoMapping.setter().-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAlways use setter-based construction - a codegen-time error if the target has no usable no-arg-constructor-plus-setters shape.Use a detected setter-based construction path only when no builder was selected (seeDtoMapping.Builder) and the target has no positional constructor matching the mapped properties, falling back silently to a positional constructor call otherwise.Never use setter-based construction, even if the target has a usable shape - always use a positional constructor instead (a codegen-time error if no matching one exists). -
Method Summary
Modifier and TypeMethodDescriptionstatic DtoMapping.SetterReturns the enum constant of this type with the specified name.static DtoMapping.Setter[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
AUTO
Use a detected setter-based construction path only when no builder was selected (seeDtoMapping.Builder) and the target has no positional constructor matching the mapped properties, falling back silently to a positional constructor call otherwise. -
ALWAYS
Always use setter-based construction - a codegen-time error if the target has no usable no-arg-constructor-plus-setters shape.Use this to pin a target to setter-based construction rather than relying on
AUTO's shape-based fallback - e.g. a legacy JAXB/mutable-JavaBean target that happens to also expose a same-arity constructorAUTOwould otherwise silently prefer instead (its parameter order may be coincidental, not actually intended for this mapping); or simply to document the intended strategy explicitly for readers. Also gives a clear@DtoMappingerror - naming the missing setter - if a setter is later renamed or removed, rather thanAUTOsilently falling through to a positional constructor call that may not compile, or may compile but populate the wrong properties. -
NEVER
Never use setter-based construction, even if the target has a usable shape - always use a positional constructor instead (a codegen-time error if no matching one exists).Use this to pin a target to positional-constructor construction rather than relying on
AUTO's shape-based fallback - e.g. a target that happens to expose both a matching positional constructor and a full set of setters (soAUTOwould already prefer the constructor anyway, butNEVERmakes that guarantee explicit and future-proof: if the constructor is later removed/changed, the mapping fails to compile immediately instead of silently switching to a setter chain no one asked for).
-
-
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
-