Interface ToStringNullable<T>

    • Method Detail

      • of

        static <T> ToStringNullable<T> of​(Function<T,​String> lambda)
        Returns a typed ToStringNullable<T> using the provided lambda.
        Type Parameters:
        T - type to extract from
        Parameters:
        lambda - to convert
        Returns:
        a typed ToStringNullable<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
      • orThrow

        default ToString<T> orThrow()
        Description copied from interface: ToNullable
        Returns an equivalent expression as this, except that it will throw a NullPointerException if given an argument that would cause this expression to return null.
        Specified by:
        orThrow in interface ToNullable<T,​String,​ToString<T>>
        Returns:
        the expression if present
      • orElseGet

        default ToString<T> orElseGet​(ToString<T> getter)
        Description copied from interface: ToNullable
        Returns an equivalent expression as this, except that it will return the getter expression if given an argument that would cause this expression to return null.
        Specified by:
        orElseGet in interface ToNullable<T,​String,​ToString<T>>
        Parameters:
        getter - to apply if null
        Returns:
        the expression if present, otherwise return getter
      • orElse

        default ToString<T> orElse​(String value)
        Description copied from interface: ToNullable
        Returns an equivalent expression as this, except that it will return the value if given an argument that would cause this expression to return null.
        Specified by:
        orElse in interface ToNullable<T,​String,​ToString<T>>
        Parameters:
        value - value to use if null
        Returns:
        the expression if present, otherwise return value
      • 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