Package org.mapstruct.ap.spi
Interface EnumTransformationStrategy
-
- All Known Implementing Classes:
CaseEnumTransformationStrategy
,PrefixEnumTransformationStrategy
,StripPrefixEnumTransformationStrategy
,StripSuffixEnumTransformationStrategy
,SuffixEnumTransformationStrategy
@Experimental("This SPI can have its signature changed in subsequent releases") public interface EnumTransformationStrategy
A service provider interface for transforming name based value mappings.- Since:
- 1.4
- Author:
- Filip Hrisafov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getStrategyName()
The name of the strategy.default void
init(MapStructProcessingEnvironment processingEnvironment)
Initializes the enum transformation strategy with the MapStruct processing environment.String
transform(String value, 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
String getStrategyName()
The name of the strategy.- Returns:
- the name of the strategy, never
null
-
transform
String transform(String value, 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
-
-