Package org.mapstruct.ap.spi
Interface EnumTransformationStrategy
-
- All Known Implementing Classes:
CaseEnumTransformationStrategy,PrefixEnumTransformationStrategy,StripPrefixEnumTransformationStrategy,StripSuffixEnumTransformationStrategy,SuffixEnumTransformationStrategy
@Experimental("This SPI can have it\'s signature changed in subsequent releases") public interface EnumTransformationStrategy
A service provider interface for transforming name based value mappings.- Since:
- 1.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.StringgetStrategyName()The name of the strategy.default voidinit(MapStructProcessingEnvironment processingEnvironment)Initializes the enum transformation strategy with the MapStruct processing environment.java.lang.Stringtransform(java.lang.String value, java.lang.String configuration)Transform the given value by using the givenconfiguration.
-
-
-
Method Detail
-
init
default void init(MapStructProcessingEnvironment processingEnvironment)
Initializes the enum transformation strategy with the MapStruct processing environment.- Parameters:
processingEnvironment- environment for facilities
-
getStrategyName
java.lang.String getStrategyName()
The name of the strategy.- Returns:
- the name of the strategy, never
null
-
transform
java.lang.String transform(java.lang.String value, java.lang.String configuration)Transform the given value by using the givenconfiguration.- Parameters:
value- the value that should be transformedconfiguration- the configuration that should be used for the transformation- Returns:
- the transformed value after applying the configuration
-
-