Class CaseInsensitiveEnumNameArgumentType<T extends java.lang.Enum<T>>

  • Type Parameters:
    T - Type of enum
    All Implemented Interfaces:
    ArgumentType<T>, MetavarInference

    public class CaseInsensitiveEnumNameArgumentType<T extends java.lang.Enum<T>>
    extends CaseInsensitiveEnumArgumentType<T>

    ArgumentType subclass for enum type using case-insensitive matching of values.

    Uses Enum.name() as the String representation of the enum.

    Since:
    0.8.0
    • Constructor Detail

      • CaseInsensitiveEnumNameArgumentType

        public CaseInsensitiveEnumNameArgumentType​(java.lang.Class<T> type)
    • Method Detail

      • forEnum

        public static <T extends java.lang.Enum<T>> CaseInsensitiveEnumNameArgumentType<T> forEnum​(java.lang.Class<T> type)

        Creates a CaseInsensitiveEnumNameArgumentType for the given enum type.

        Type Parameters:
        T - The type of the enum
        Parameters:
        type - type of the enum the CaseInsensitiveEnumNameArgumentType should convert to
        Returns:
        a CaseInsensitiveEnumNameArgumentType that converts Strings to type
      • getStringRepresentations

        protected java.lang.Object[] getStringRepresentations()
        Description copied from class: CaseInsensitiveEnumArgumentType

        Get the objects to be used to generate the String representations of all enum constants. Object.toString() will be invoked on these objects to obtain the actual String representation.

        Overrides:
        getStringRepresentations in class CaseInsensitiveEnumArgumentType<T extends java.lang.Enum<T>>
        Returns:
        The objects used to generate String representations.