Class EnumConverter<T extends Enum<T>>

java.lang.Object
com.bc.ceres.binding.converters.EnumConverter<T>
All Implemented Interfaces:
Converter<T>

public class EnumConverter<T extends Enum<T>> extends Object implements Converter<T>
Class for converting enumeration types.
Version:
$Revision$ $Date$
  • Constructor Details

    • EnumConverter

      public EnumConverter(Class<T> type)
  • Method Details

    • getValueType

      public Class<T> getValueType()
      Description copied from interface: Converter
      Gets the value type.
      Specified by:
      getValueType in interface Converter<T extends Enum<T>>
      Returns:
      The value type.
    • parse

      public T parse(String text) throws ConversionException
      Description copied from interface: Converter
      Converts a value from its plain text representation to a Java object instance of the type returned by Converter.getValueType().
      Specified by:
      parse in interface Converter<T extends Enum<T>>
      Parameters:
      text - The textual representation of the value.
      Returns:
      The converted value.
      Throws:
      ConversionException - If the conversion fails.
    • format

      public String format(T value)
      Description copied from interface: Converter
      Converts a value of the type returned by Converter.getValueType() to its plain text representation.
      Specified by:
      format in interface Converter<T extends Enum<T>>
      Parameters:
      value - The value to be converted to text.
      Returns:
      The textual representation of the value.