Class EnumConverter<T extends Enum>

java.lang.Object
org.csveed.bean.conversion.AbstractConverter<T>
org.csveed.bean.conversion.EnumConverter<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
Converter<T>

public class EnumConverter<T extends Enum> extends AbstractConverter<T>
The Class EnumConverter.
  • Field Details

    • enumClass

      public final Class<T extends Enum> enumClass
      The enum class.
  • Constructor Details

    • EnumConverter

      public EnumConverter(Class<T> enumClass)
      Instantiates a new enum converter.
      Parameters:
      enumClass - the enum class
  • Method Details

    • fromString

      public T fromString(String text) throws Exception
      Description copied from interface: Converter
      From string.
      Parameters:
      text - the text
      Returns:
      the k
      Throws:
      Exception - the exception
    • toString

      public String toString(T value) throws Exception
      Description copied from interface: Converter
      To string.
      Parameters:
      value - the value
      Returns:
      the string
      Throws:
      Exception - the exception