Package com.linecorp.armeria.common.util
Class Functions
java.lang.Object
com.linecorp.armeria.common.util.Functions
Utility methods related with function composition.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A,
B, C> Function <A, C> static <A,
B, C, D>
Function<A, D> static <A,
B, C, D, E>
Function<A, E> static <A,
B, C, D, E, F>
Function<A, F> static <A,
B, C, D, E, F, G>
Function<A, G> compose
(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6) static <A,
B, C, D, E, F, G, H>
Function<A, H> compose
(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6, Function<G, H> f7) static <A,
B, C, D, E, F, G, H, I>
Function<A, I> compose
(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6, Function<G, H> f7, Function<H, I> f8) static <A,
B, C, D, E, F, G, H, I, J>
Function<A, J> compose
(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6, Function<G, H> f7, Function<H, I> f8, Function<I, J> f9) static <T,
U> BiFunction <T, U, T> first()
Returns aBiFunction
that returns the first argument.static <T,
U> BiFunction <T, U, U> second()
Returns aBiFunction
that returns the second argument.static <T,
U> BiFunction <T, U, Void> voidFunction
(BiConsumer<T, U> consumer) voidFunction
(Consumer<T> consumer)
-
Method Details
-
compose
Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D> D> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D, E> E> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D, E, F> F> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D, E, F, G> G> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D, E, F, G, H> H> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6, Function<G, H> f7) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D, E, F, G, H, I> I> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6, Function<G, H> f7, Function<H, I> f8) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
compose
public static <A,B, Function<A,C, D, E, F, G, H, I, J> J> compose(Function<A, B> f1, Function<B, C> f2, Function<C, D> f3, Function<D, E> f4, Function<E, F> f5, Function<F, G> f6, Function<G, H> f7, Function<H, I> f8, Function<I, J> f9) Returns aFunction
that composes the specifiedFunction
s with chainedFunction.andThen(Function)
. It is useful when you need to compose method handles, which is impossible withFunction.andThen(Function)
:Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
-
voidFunction
-
voidFunction
-
first
Returns aBiFunction
that returns the first argument. -
second
Returns aBiFunction
that returns the second argument.
-