Class BiFunctionSupport
- java.lang.Object
-
- net.shibboleth.utilities.java.support.logic.BiFunctionSupport
-
public final class BiFunctionSupport extends Object
Helper class for constructingBiFunctions in a Spring-friendly manner.- Since:
- 8.1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description privateBiFunctionSupport()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A,B,C,D>
BiFunction<A,B,D>compose(Function<? super C,? extends D> g, BiFunction<A,B,? extends C> f)A static version ofBiFunction.andThen(Function).static <T,U,V>
BiFunction<T,U,V>constant(V target)Creates aBiFunctionthat returns a constant value.static <T,U>
BiFunction<T,U,Boolean>forBiPredicate(BiPredicate<? super T,? super U> predicate)Creates aBiFunctionthat returns the same boolean output as the givenBiPredicatefor all inputs.
-
-
-
Method Detail
-
constant
@Nonnull public static <T,U,V> BiFunction<T,U,V> constant(@Nonnull @ParameterName(name="target") V target)
Creates aBiFunctionthat returns a constant value.- Type Parameters:
T- type of object the function needs to act onU- type of object the function needs to act onV- type of object being returned- Parameters:
target- the value to return from the function- Returns:
- the constructed function
-
compose
@Nonnull public static <A,B,C,D> BiFunction<A,B,D> compose(@Nonnull @ParameterName(name="g") Function<? super C,? extends D> g, @Nonnull @ParameterName(name="f") BiFunction<A,B,? extends C> f)
A static version ofBiFunction.andThen(Function).- Type Parameters:
A- input to composedBiFunctionB- input to composedBiFunctionC- output of inputBiFunctionD- output of composedBiFunction- Parameters:
g- the second function to applyf- the firstBiFunctionto apply- Returns:
- the composition of
fandg - See Also:
- function composition
-
forBiPredicate
@Nonnull public static <T,U> BiFunction<T,U,Boolean> forBiPredicate(@Nonnull @ParameterName(name="predicate") BiPredicate<? super T,? super U> predicate)
Creates aBiFunctionthat returns the same boolean output as the givenBiPredicatefor all inputs.- Type Parameters:
T- input typeU- input type- Parameters:
predicate- inputBiPredicate- Returns:
- a corresponding
BiFunction
-
-