Interface ToNullable<T,​R,​NON_NULLABLE extends Expression<T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default IsNotNull<T,​R> isNotNull()
      Returns a Predicate that is false for any values that would make this expression return null and true for any values that would make this expression return a result.
      default boolean isNotNull​(T object)
      Returns false if the specified object would cause this methods Function.apply(Object)-method to return null, and otherwise true.
      default IsNull<T,​R> isNull()
      Returns a Predicate that is true for any values that would make this expression return null and false for any values that would make this expression return a result.
      default boolean isNull​(T object)
      Returns true if the specified object would cause this methods Function.apply(Object)-method to return null, and otherwise false.
      NON_NULLABLE orElse​(R value)
      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.
      NON_NULLABLE orElseGet​(NON_NULLABLE getter)
      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.
      NON_NULLABLE orThrow()
      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.
    • Method Detail

      • isNull

        default IsNull<T,​R> isNull()
        Returns a Predicate that is true for any values that would make this expression return null and false for any values that would make this expression return a result.
        Returns:
        a predicate that tests if this expression would return null
      • isNotNull

        default IsNotNull<T,​R> isNotNull()
        Returns a Predicate that is false for any values that would make this expression return null and true for any values that would make this expression return a result.
        Returns:
        a predicate that tests if this expression would return something other than null
      • isNull

        default boolean isNull​(T object)
        Returns true if the specified object would cause this methods Function.apply(Object)-method to return null, and otherwise false.
        Parameters:
        object - the incoming entity to test on
        Returns:
        true if the expression would return null, else false
      • isNotNull

        default boolean isNotNull​(T object)
        Returns false if the specified object would cause this methods Function.apply(Object)-method to return null, and otherwise true.
        Parameters:
        object - the incoming entity to test on
        Returns:
        false if the expression would return null, else true
      • orThrow

        NON_NULLABLE orThrow()
        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.
        Returns:
        the expression if present
      • orElseGet

        NON_NULLABLE orElseGet​(NON_NULLABLE getter)
        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.
        Parameters:
        getter - to apply if null
        Returns:
        the expression if present, otherwise return getter
      • orElse

        NON_NULLABLE orElse​(R value)
        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.
        Parameters:
        value - value to use if null
        Returns:
        the expression if present, otherwise return value