Package net.shibboleth.ext.spring.util
Class SpringExpressionBiPredicate<T,U>
- java.lang.Object
-
- net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
-
- net.shibboleth.ext.spring.util.SpringExpressionBiPredicate<T,U>
-
- Type Parameters:
T- first input typeU- second input type
- All Implemented Interfaces:
BiPredicate<T,U>
public class SpringExpressionBiPredicate<T,U> extends AbstractSpringExpressionEvaluatorEx implements BiPredicate<T,U>
Predicate whose condition is defined by an Spring EL expression.- Since:
- 6.1.0
-
-
Constructor Summary
Constructors Constructor Description SpringExpressionBiPredicate(String expression)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pair<Class<T>,Class<U>>getInputTypes()Get the input type to be enforced.protected voidprepareContext(EvaluationContext context, Object... input)Pre-process the script context before execution.voidsetInputTypes(Pair<Class<T>,Class<U>> types)Set the input types to be enforced.voidsetReturnOnError(boolean flag)Set value to return if an error occurs.booleantest(T first, U second)-
Methods inherited from class net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
evaluate, getCustomObject, getOutputType, getReturnOnError, setCustomObject, setHideExceptions, setOutputType, setReturnOnError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiPredicate
and, negate, or
-
-
-
-
Constructor Detail
-
SpringExpressionBiPredicate
public SpringExpressionBiPredicate(@Nonnull @NotEmpty @ParameterName(name="expression") String expression)
Constructor.- Parameters:
expression- the expression to evaluate
-
-
Method Detail
-
getInputTypes
@Nullable public Pair<Class<T>,Class<U>> getInputTypes()
Get the input type to be enforced.- Returns:
- input type
-
setInputTypes
public void setInputTypes(@Nullable Pair<Class<T>,Class<U>> types)Set the input types to be enforced.- Parameters:
types- the input types
-
setReturnOnError
public void setReturnOnError(boolean flag)
Set value to return if an error occurs.- Parameters:
flag- value to return
-
test
public boolean test(@Nullable T first, @Nullable U second)- Specified by:
testin interfaceBiPredicate<T,U>
-
prepareContext
protected void prepareContext(@Nonnull EvaluationContext context, @Nullable Object... input)Pre-process the script context before execution.- Specified by:
prepareContextin classAbstractSpringExpressionEvaluatorEx- Parameters:
context- the expression contextinput- the inputs
-
-