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

    Modifier and Type
    Method
    Description
    The name of the strategy.
    default void
    init(MapStructProcessingEnvironment processingEnvironment)
    Initializes the enum transformation strategy with the MapStruct processing environment.
    transform(String value, String configuration)
    Transform the given value by using the given configuration.
  • Method Details

    • 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 given configuration.
      Parameters:
      value - the value that should be transformed
      configuration - the configuration that should be used for the transformation
      Returns:
      the transformed value after applying the configuration