Interface ToString<T>

    • Method Detail

      • of

        static <T> ToString<T> of​(Function<T,​String> lambda)
        Returns a typed ToString<T> using the provided lambda.
        Type Parameters:
        T - type to extract from
        Parameters:
        lambda - to convert
        Returns:
        a typed ToString<T> using the provided lambda
        Throws:
        NullPointerException - if the provided lambda is null
      • expressionType

        default ExpressionType expressionType()
        Description copied from interface: Expression
        Returns the expression type of this expression. It should be safe to cast this instance into the corresponding interface.
        Specified by:
        expressionType in interface Expression<T>
        Returns:
        the expression type
      • map

        default ToString<T> map​(UnaryOperator<String> mapper)
        Description copied from interface: HasMap
        Returns an expression for the value of this expression mapped using the specified mapping function. The input type remains the same.
        Specified by:
        map in interface HasMap<T,​UnaryOperator<String>,​ToString<T>>
        Parameters:
        mapper - the mapping function
        Returns:
        the mapped expression
      • toUpperCase

        default ToString<T> toUpperCase()
        Description copied from interface: HasCase
        Returns an expression that is equivalent to this expression, except that results are always in upper-case letters.
        Specified by:
        toUpperCase in interface HasCase<T,​ToString<T>>
        Returns:
        the upper case expression
      • toLowerCase

        default ToString<T> toLowerCase()
        Description copied from interface: HasCase
        Returns an expression that is equivalent to this expression, except that results are always in lower-case letters.
        Specified by:
        toLowerCase in interface HasCase<T,​ToString<T>>
        Returns:
        the lower case expression
      • hash

        default long hash​(T object)
        Description copied from interface: HasHash
        Hash the specified object into a 64-bit hash. If two equal objects are hashed, they must always result in the same hash. However, objects that are not equal may also result in the same hash.
        Specified by:
        hash in interface HasHash<T>
        Parameters:
        object - the object to hash
        Returns:
        the 64-bit hashcode
      • compose

        default <V> ToStringNullable<V> compose​(Function<? super V,​? extends T> before)
        Description copied from interface: HasCompose
        Returns a composed expression that first applies the before function to its input, and then applies this function to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.
        Specified by:
        compose in interface Function<T,​String>
        Specified by:
        compose in interface HasCompose<T>
        Type Parameters:
        V - the type of input to the before function, and to the composed expression
        Parameters:
        before - the function to apply before this function is applied
        Returns:
        a composed function that first applies the before function and then applies this function