Class StringConverter.Enum<T extends Enum<T>>

All Implemented Interfaces:
Serializable, Function<String,T>, ObjectConverter<String,T>
Enclosing class:
StringConverter<T>

static final class StringConverter.Enum<T extends Enum<T>> extends StringConverter<T>
Converter from String to Enum. This converter is particular in that it requires the target class in argument to the constructor.

Instances of this class are created by SystemRegistry.createConverter(Class, Class).

  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility on serialization.
      See Also:
  • Constructor Details

    • Enum

      Enum(Class<T> targetClass)
      Creates a new converter for the given enumeration.
  • Method Details

    • doConvert

      T doConvert(String source)
      Converts the given string to the target type of this converter.
      Specified by:
      doConvert in class StringConverter<T extends Enum<T>>
      Parameters:
      source - the string to convert, guaranteed to be non-null and non-empty.
      Returns:
      the converted value.
    • createInverse

      ObjectConverter<T,String> createInverse()
      Invoked by the constructor for creating the inverse converter.
      Overrides:
      createInverse in class StringConverter<T extends Enum<T>>