Interface BuildableComparableOptionalFunction<T,R extends Comparable<R>>

All Superinterfaces:
BuildableOptionalFunction<T,R>, ComparableFunction<T,R>, Function<T,Optional<R>>
All Known Subinterfaces:
BuildableStringOptionalFunction<T>

public interface BuildableComparableOptionalFunction<T,R extends Comparable<R>> extends BuildableOptionalFunction<T,R>, ComparableFunction<T,R>
A function of one argument that generates an Optional<Comparable> result, and supports building derived functional types.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <U extends T>
    Comparator<U>
    Returns a Comparator that orders objects using the optional values mapped by this function, with empty values considered less than non-empty.
    default <U extends T>
    Comparator<U>
    Returns a Comparator that orders objects using the optional values mapped by this function, with empty values considered greater than non-empty.
    is(R test)
    Returns a predicate that tests the value generated by this for equality with the supplied constant.
    Returns a predicate that tests the value generated by this to see if it is greater than the supplied constant.
    Returns a predicate that tests the value generated by this to see if it is greater than or equal to the supplied constant.
    isLessThan(R test)
    Returns a predicate that tests the value generated by this to see if it is less than the supplied constant.
    Returns a predicate that tests the value generated by this to see if it is less than or equal to the supplied constant.

    Methods inherited from interface com.terracottatech.store.function.BuildableOptionalFunction

    in, in

    Methods inherited from interface java.util.function.Function

    andThen, apply, compose
  • Method Details

    • isGreaterThan

      default BuildablePredicate<T> isGreaterThan(R test)
      Returns a predicate that tests the value generated by this to see if it is greater than the supplied constant. If this is a function that generates an empty Optional, the returned predicate would always evaluate to false.
      Specified by:
      isGreaterThan in interface ComparableFunction<T,R extends Comparable<R>>
      Parameters:
      test - value to test against
      Returns:
      a greater than predicate
    • isLessThan

      default BuildablePredicate<T> isLessThan(R test)
      Returns a predicate that tests the value generated by this to see if it is less than the supplied constant. If this is a function that generates an empty Optional, the returned predicate would always evaluate to false
      Specified by:
      isLessThan in interface ComparableFunction<T,R extends Comparable<R>>
      Parameters:
      test - value to test against
      Returns:
      a less than predicate
    • isGreaterThanOrEqualTo

      default BuildablePredicate<T> isGreaterThanOrEqualTo(R test)
      Returns a predicate that tests the value generated by this to see if it is greater than or equal to the supplied constant. If this is a function that generates an empty Optional, the returned predicate would always evaluate to false
      Specified by:
      isGreaterThanOrEqualTo in interface ComparableFunction<T,R extends Comparable<R>>
      Parameters:
      test - value to test against
      Returns:
      a greater than or equal to predicate
    • isLessThanOrEqualTo

      default BuildablePredicate<T> isLessThanOrEqualTo(R test)
      Returns a predicate that tests the value generated by this to see if it is less than or equal to the supplied constant. If this is a function that generates an empty Optional, the returned predicate would always evaluate to false
      Specified by:
      isLessThanOrEqualTo in interface ComparableFunction<T,R extends Comparable<R>>
      Parameters:
      test - value to test against
      Returns:
      a less than or equal to predicate
    • emptiesFirst

      default <U extends T> Comparator<U> emptiesFirst()
      Returns a Comparator that orders objects using the optional values mapped by this function, with empty values considered less than non-empty.
      Returns:
      a comparator that orders using the mapped optional values
    • emptiesLast

      default <U extends T> Comparator<U> emptiesLast()
      Returns a Comparator that orders objects using the optional values mapped by this function, with empty values considered greater than non-empty.
      Returns:
      a comparator that orders using the mapped optional values
    • is

      default BuildablePredicate<T> is(R test)
      Description copied from interface: BuildableOptionalFunction
      Returns a predicate that tests the value generated by this for equality with the supplied constant. If this is a function that generates an empty Optional, the returned predicate would always evaluate to false

      Equality is defined by the behavior of the Objects.deepEquals(java.lang.Object, java.lang.Object) method.

      Specified by:
      is in interface BuildableOptionalFunction<T,R extends Comparable<R>>
      Specified by:
      is in interface ComparableFunction<T,R extends Comparable<R>>
      Parameters:
      test - value to test against
      Returns:
      an equality predicate