Package org.jooq

Class Converters<T,​U>

  • Type Parameters:
    T - The database type - i.e. any type available from SQLDataType
    U - The user type
    All Implemented Interfaces:
    java.io.Serializable, Converter<T,​U>

    public class Converters<T,​U>
    extends java.lang.Object
    implements Converter<T,​U>
    A chain of converters.
    Author:
    Lukas Eder
    See Also:
    Serialized Form
    • Method Detail

      • identity

        public static <T> Converter<T,​T> identity​(java.lang.Class<T> type)
        Create an identity converter.
      • of

        public static <T,​U> Converter<T,​U> of()
        Create an identity converter.
      • of

        public static <T,​U> Converter<T,​U> of​(Converter<T,​U> converter)
        Create a single converter.
      • of

        public static <T,​X1,​U> Converter<T,​U> of​(Converter<T,​? extends X1> c1,
                                                                   Converter<? super X1,​U> c2)
        Chain two converters.
      • of

        public static <T,​X1,​X2,​U> Converter<T,​U> of​(Converter<T,​? extends X1> c1,
                                                                            Converter<? super X1,​? extends X2> c2,
                                                                            Converter<? super X2,​U> c3)
        Chain three converters.
      • of

        public static <T,​X1,​X2,​X3,​U> Converter<T,​U> of​(Converter<T,​? extends X1> c1,
                                                                                     Converter<? super X1,​? extends X2> c2,
                                                                                     Converter<? super X2,​? extends X3> c3,
                                                                                     Converter<? super X3,​U> c4)
        Chain four converters.
      • inverse

        public static <T,​U> Converter<U,​T> inverse​(Converter<T,​U> converter)
        Inverse a converter.
      • from

        public final U from​(T t)
        Description copied from interface: Converter
        Convert a database object to a user object
        Specified by:
        from in interface Converter<T,​U>
        Parameters:
        t - The database object
        Returns:
        The user object
      • to

        public final T to​(U u)
        Description copied from interface: Converter
        Convert a user object to a database object
        Specified by:
        to in interface Converter<T,​U>
        Parameters:
        u - The user object
        Returns:
        The database object
      • fromType

        public final java.lang.Class<T> fromType()
        Description copied from interface: Converter
        The database type
        Specified by:
        fromType in interface Converter<T,​U>
      • toType

        public final java.lang.Class<U> toType()
        Description copied from interface: Converter
        The user type
        Specified by:
        toType in interface Converter<T,​U>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object