Package de.xima.fc.condition
Class CompoundConditionEvaluator
- java.lang.Object
-
- de.xima.fc.condition.CompoundConditionEvaluator
-
- All Implemented Interfaces:
Predicate<ICompoundConditionData>
public final class CompoundConditionEvaluator extends Object implements Predicate<ICompoundConditionData>
Predicate that combines multiple single conditions via aEMultipleConditionCombinationType
.- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompoundConditionEvaluator
create(Locale locale)
Creates a new multiple condition check that combines the results of individual checks.boolean
test(ICompoundConditionData data)
<T> boolean
test(EMultipleConditionCombinationType combinationType, String customExpression, Iterable<T> items, Function<T,Map.Entry<String,Boolean>> evaluator)
Combines the given conditions via the combination type.boolean
test(EMultipleConditionCombinationType combinationType, String customExpression, Map<String,Boolean> singleResults)
Combines the given conditions via the combination type.
-
-
-
Method Detail
-
test
public <T> boolean test(EMultipleConditionCombinationType combinationType, String customExpression, Iterable<T> items, Function<T,Map.Entry<String,Boolean>> evaluator)
Combines the given conditions via the combination type.- Type Parameters:
T
- Type of the items.- Parameters:
combinationType
- How to combine the individual results.customExpression
- Custom combination expression forEMultipleConditionCombinationType.CUSTOM
.items
- A list of items representing the individual conditions.evaluator
- Takes a single condition and evaluates it. The key must be the name of the condition forEMultipleConditionCombinationType.CUSTOM
.- Returns:
- The result of combining the individual results via the given combination type.
-
test
public boolean test(EMultipleConditionCombinationType combinationType, String customExpression, Map<String,Boolean> singleResults)
Combines the given conditions via the combination type.- Parameters:
combinationType
- How to combine the individual results.singleResults
- Outcomes of the individual tests. The key is the variable name of the test forEMultipleConditionCombinationType.CUSTOM
.customExpression
- Custom combination expression forEMultipleConditionCombinationType.CUSTOM
.- Returns:
- The result of combining the individual results via the given combination type.
-
test
public boolean test(ICompoundConditionData data)
- Specified by:
test
in interfacePredicate<ICompoundConditionData>
-
create
public static CompoundConditionEvaluator create(Locale locale)
Creates a new multiple condition check that combines the results of individual checks.- Parameters:
locale
- Locale to use for error message.- Returns:
- A new evaluator that renders error messages with the given locale.f
-
-