Class Constants

java.lang.Object
com.terracottatech.store.function.Constants

public class Constants extends Object
Provides functionally transparent constant bearing functions of various arities.
  • Constructor Details

    • Constants

      public Constants()
  • Method Details

    • predicate

      public static <T> BuildablePredicate<T> predicate(boolean value)
      Returns a Predicate that always returns the constant value.
      Type Parameters:
      T - predicate input type
      Parameters:
      value - constant boolean value
      Returns:
      a constant bearing predicate
    • function

      public static <T, R> BuildableFunction<T,R> function(R value)
      Returns a Function that always returns the constant value.
      Type Parameters:
      T - function input type
      R - constant type
      Parameters:
      value - constant value
      Returns:
      a constant bearing function
    • biFunction

      public static <T, U, R> BiFunction<T,U,R> biFunction(R value)
      Returns a BiFunction that always returns the constant value.
      Type Parameters:
      T - first function input type
      U - second function input type
      R - constant type
      Parameters:
      value - constant value
      Returns:
      a constant bearing bi-function