Interface TriFunction<T,​U,​V,​R>

Type Parameters:
T - the type of the first argument to the function
U - the type of the second argument to the function
V - the type of the third argument to the function
R - the type of the result of the function
All Known Subinterfaces:
TernaryOperator<T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface TriFunction<T,​U,​V,​R>
Represents a function that accepts three arguments and produces a result. This is the three-arity specialization of Function.

This is a functional interface whose functional method is apply(Object, Object, Object).

Since:
1.8
See Also:
Function
  • Method Summary

    Modifier and Type Method Description
    R apply​(T t, U u, V v)
    Applies this function to the given arguments.
    default Supplier<R> applyPartial​(T t, U u, V v)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default BiFunction<V,​U,​R> applyPartialL​(T t)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default Function<V,​R> applyPartialLM​(T t, U u)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default Function<U,​R> applyPartialLR​(T t, V v)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default BiFunction<T,​V,​R> applyPartialM​(U u)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default Function<T,​R> applyPartialMR​(U u, V v)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default BiFunction<T,​U,​R> applyPartialR​(V v)
    Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
    default TriConsumer<T,​U,​V> consume​(Consumer<R> consumer)
    Consume a function.
    default <S> TriFunction<T,​U,​V,​S> map​(Function<? super R,​? extends S> functor)
    Lift a function.
  • Method Details

    • apply

      R apply​(T t, U u, V v)
      Applies this function to the given arguments.
      Parameters:
      t - the first function argument
      u - the second function argument
      v - the third function argument
      Returns:
      the function result
    • applyPartial

      default Supplier<R> applyPartial​(T t, U u, V v)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      t - the first function argument
      u - the second function argument
      v - the third function argument
      Returns:
      the function result
    • applyPartialLM

      default Function<V,​R> applyPartialLM​(T t, U u)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      t - the first function argument
      u - the second function argument
      Returns:
      the function result
    • applyPartialLR

      default Function<U,​R> applyPartialLR​(T t, V v)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      t - the first function argument
      v - the third function argument
      Returns:
      the function result
    • applyPartialMR

      default Function<T,​R> applyPartialMR​(U u, V v)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      u - the second function argument
      v - the third function argument
      Returns:
      the function result
    • applyPartialL

      default BiFunction<V,​U,​R> applyPartialL​(T t)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      t - the first function argument
      Returns:
      the function result
    • applyPartialM

      default BiFunction<T,​V,​R> applyPartialM​(U u)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      u - the second function argument
      Returns:
      the function result
    • applyPartialR

      default BiFunction<T,​U,​R> applyPartialR​(V v)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      v - the third function argument
      Returns:
      the function result
    • consume

      default TriConsumer<T,​U,​V> consume​(Consumer<R> consumer)
      Consume a function.
      Parameters:
      consumer - The consumer to use in consuming.
      Returns:
      A Consumer which passes it's argument to this function and then passes the result into the given consumer.
    • map

      default <S> TriFunction<T,​U,​V,​S> map​(Function<? super R,​? extends S> functor)
      Lift a function.
      Type Parameters:
      S - The return type.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.