Class Functions

java.lang.Object
org.wildfly.clustering.cache.function.Functions

public class Functions extends Object
Reusable function implementations.
Author:
Paul Ferraro
  • Method Details

    • constantFunction

      public static <T, R> Function<T,R> constantFunction(R result)
      Returns a function that always returns a constant result, regardless of input.
      Type Parameters:
      T - the function parameter type
      Returns:
      a function that always returns the specified result
    • constantIntFunction

      public static <R> IntFunction<R> constantIntFunction(R result)
      Returns a function that always returns a constant result, regardless of input.
      Type Parameters:
      T - the function parameter type
      Returns:
      a function that always returns the specified result
    • constantLongFunction

      public static <R> LongFunction<R> constantLongFunction(R result)
      Returns a function that always returns a constant result, regardless of input.
      Type Parameters:
      T - the function parameter type
      Returns:
      a function that always returns the specified result
    • constantDoubleFunction

      public static <R> DoubleFunction<R> constantDoubleFunction(R result)
      Returns a function that always returns a constant result, regardless of input.
      Type Parameters:
      T - the function parameter type
      Returns:
      a function that always returns the specified result