Class DefaultEnumMappingStrategy

    • Field Detail

      • elementUtils

        protected Elements elementUtils
      • typeUtils

        protected Types typeUtils
    • Constructor Detail

      • DefaultEnumMappingStrategy

        public DefaultEnumMappingStrategy()
    • Method Detail

      • getEnumConstant

        public String getEnumConstant​(TypeElement enumType,
                                      String enumConstant)
        Description copied from interface: EnumMappingStrategy
        Map the enum constant to the value use for matching. In case you want this enum constant to match to null return MappingConstants.NULL
        Specified by:
        getEnumConstant in interface EnumMappingStrategy
        Parameters:
        enumType - the enum this constant belongs to
        enumConstant - constant to transform
        Returns:
        the transformed constant - or the original value from the parameter if no transformation is needed. never return null
      • getUnexpectedValueMappingExceptionType

        public TypeElement getUnexpectedValueMappingExceptionType()
        Description copied from interface: EnumMappingStrategy
        Return the type element of the exception that should be used in the generated code for an unexpected enum constant.
        Specified by:
        getUnexpectedValueMappingExceptionType in interface EnumMappingStrategy
        Returns:
        the type element of the exception that should be used, never null
      • getUnexpectedValueMappingExceptionClass

        protected Class<? extends Exception> getUnexpectedValueMappingExceptionClass()