@Experimental(value="This SPI can have it\'s signature changed in subsequent releases") public interface EnumMappingStrategy
Modifier and Type | Method and Description |
---|---|
String |
getDefaultNullEnumConstant(TypeElement enumType)
Return the default enum constant to use if the source is null.
|
String |
getEnumConstant(TypeElement enumType,
String enumConstant)
Map the enum constant to the value use for matching.
|
TypeElement |
getUnexpectedValueMappingExceptionType()
Return the type element of the exception that should be used in the generated code
for an unexpected enum constant.
|
default void |
init(MapStructProcessingEnvironment processingEnvironment)
Initializes the enum value mapping strategy
|
default void init(MapStructProcessingEnvironment processingEnvironment)
processingEnvironment
- environment for facilitiesString getDefaultNullEnumConstant(TypeElement enumType)
enumType
- the enumString getEnumConstant(TypeElement enumType, String enumConstant)
MappingConstants.NULL
enumType
- the enum this constant belongs toenumConstant
- constant to transformTypeElement getUnexpectedValueMappingExceptionType()
null
Copyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.