Class AbstractTypeConvertingFunction<T,​R,​U extends AbstractTypeConvertingFunction<T,​R,​U>>

  • Type Parameters:
    T - The type of the underlying column. For example, if a function converts a VARCHAR to an INT, then the underlying type will be a String
    R - The type of the column after the conversion. For example, if a function converts a VARCHAR to an INT, then the converted type will be Integer
    U - the specific subtype that implements the function
    All Implemented Interfaces:
    BasicColumn, BindableColumn<R>
    Direct Known Subclasses:
    AbstractUniTypeFunction

    public abstract class AbstractTypeConvertingFunction<T,​R,​U extends AbstractTypeConvertingFunction<T,​R,​U>>
    extends Object
    implements BindableColumn<R>
    Represents a function that can change the underlying type. For example, converting a binary field for a base64 string, or an integer to a string, etc.

    Thanks to @endink for the idea.

    Author:
    Jeff Butler
    • Constructor Detail

      • AbstractTypeConvertingFunction

        protected AbstractTypeConvertingFunction​(BindableColumn<T> column)
    • Method Detail

      • alias

        public Optional<String> alias()
        Description copied from interface: BasicColumn
        Returns the columns alias if one has been specified.
        Specified by:
        alias in interface BasicColumn
        Returns:
        the column alias
      • as

        public U as​(String alias)
        Description copied from interface: BindableColumn
        Override the base method definition to make it more specific to this interface.
        Specified by:
        as in interface BasicColumn
        Specified by:
        as in interface BindableColumn<T>
        Parameters:
        alias - the column alias to set
        Returns:
        new instance with alias set
      • copy

        protected abstract U copy()