Class AbstractTriStatePredicate<T>
java.lang.Object
net.shibboleth.utilities.java.support.logic.AbstractTriStatePredicate<T>
- Type Parameters:
T
- the type to which the predicate is applied
public abstract class AbstractTriStatePredicate<T> extends Object implements Predicate<T>
A base
Predicate
implementation which provides support for cases where the
predicate can not meaningfully evaluate the input. The flags on this class
allow translating these cases to a boolean true
or false
as required by the predicate interface.-
Field Summary
Fields Modifier and Type Field Description private boolean
nullInputSatisfies
Flag indicating whether the null input case is treated as satisfying the predicate.private boolean
unevaluableSatisfies
Flag indicating whether the general unevaluable case is treated as satisfying the predicate. -
Constructor Summary
Constructors Constructor Description AbstractTriStatePredicate()
-
Method Summary
Modifier and Type Method Description boolean
isNullInputSatisfies()
Get the flag indicating whether a null input satisfies the predicate.boolean
isUnevaluableSatisfies()
Get the flag indicating whether a general 'unevaluable' input satisfies the predicate.void
setNullInputSatisfies(boolean flag)
Set the flag indicating whether a null input satisfies the predicate.void
setUnevaluableSatisfies(boolean flag)
Set the flag indicating whether a general 'unevaluable' input satisfies the predicate.
-
Field Details
-
nullInputSatisfies
private boolean nullInputSatisfiesFlag indicating whether the null input case is treated as satisfying the predicate. -
unevaluableSatisfies
private boolean unevaluableSatisfiesFlag indicating whether the general unevaluable case is treated as satisfying the predicate.
-
-
Constructor Details
-
AbstractTriStatePredicate
public AbstractTriStatePredicate()
-
-
Method Details
-
isNullInputSatisfies
public boolean isNullInputSatisfies()Get the flag indicating whether a null input satisfies the predicate.- Returns:
- true if should satisfy, false otherwise
-
setNullInputSatisfies
public void setNullInputSatisfies(boolean flag)Set the flag indicating whether a null input satisfies the predicate.- Parameters:
flag
- true if should satisfy, false otherwise
-
isUnevaluableSatisfies
public boolean isUnevaluableSatisfies()Get the flag indicating whether a general 'unevaluable' input satisfies the predicate.- Returns:
- true if should satisfy, false otherwise
-
setUnevaluableSatisfies
public void setUnevaluableSatisfies(boolean flag)Set the flag indicating whether a general 'unevaluable' input satisfies the predicate.- Parameters:
flag
- true if should satisfy, false otherwise
-