Package org.jooq.impl

Class EnumConverter<T,​U extends java.lang.Enum<U>>

  • All Implemented Interfaces:
    java.io.Serializable, Converter<T,​U>

    public class EnumConverter<T,​U extends java.lang.Enum<U>>
    extends AbstractConverter<T,​U>
    A base class for enum conversion.
    Author:
    Lukas Eder
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      EnumConverter​(java.lang.Class<T> fromType, java.lang.Class<U> toType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      U from​(T databaseObject)
      Convert a database object to a user object
      T to​(U userObject)
      Subclasses may override this method to provide a custom reverse mapping implementation
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EnumConverter

        public EnumConverter​(java.lang.Class<T> fromType,
                             java.lang.Class<U> toType)
    • Method Detail

      • from

        public final U from​(T databaseObject)
        Description copied from interface: Converter
        Convert a database object to a user object
        Parameters:
        databaseObject - The database object
        Returns:
        The user object
      • to

        public T to​(U userObject)
        Subclasses may override this method to provide a custom reverse mapping implementation

        Convert a user object to a database object

        Parameters:
        userObject - The user object
        Returns:
        The database object