Class PredicateDrivenFunction<T,U>
- java.lang.Object
-
- net.shibboleth.utilities.java.support.logic.PredicateDrivenFunction<T,U>
-
- Type Parameters:
T- type of input accepted by this functionU- type of output produced by this function
- All Implemented Interfaces:
Function<T,U>
@ThreadSafe public class PredicateDrivenFunction<T,U> extends Object implements Function<T,U>
AFunctionthat runs aPredicateand then runs one of two other possible functions based on the result.If either function is null, the result will be null if that function were needed.
- Since:
- 8.2.0
-
-
Constructor Detail
-
PredicateDrivenFunction
public PredicateDrivenFunction(@Nonnull @ParameterName(name="condition") Predicate<? super T> condition, @Nullable @ParameterName(name="whenTrue") Function<? super T,U> whenTrue, @Nullable @ParameterName(name="whenFalse") Function<? super T,U> whenFalse)
Constructor.- Parameters:
condition- predicate to applywhenTrue- function to apply if predicate evaluates to truewhenFalse- function to apply if predicate evaluates to false
-
-