Interface Condition
- All Known Implementing Classes:
AndCondition,ArrayContains,HasSize,HasValue,HasValueWithLooseType,Ignore,IsEmpty,JsonAt,JsonIsNotNull,MatcherCondition,MatchesTextCondition,MissingCondition,Not,NullCondition,NumberCondition,ObjectContainsKeys,OrCondition,PredicateWrappedCondition,TreeComparisonCondition
public interface Condition
A condition that the data must meet in order to pass the test
-
Method Summary
Modifier and TypeMethodDescriptiondefault ConditionAdd a second condition to this one using and logic.describe()Describe the conditiondefault Conditioninverted()Invert the condition - i.e.default ConditionAdd a second condition to this one using or logic.test(com.fasterxml.jackson.databind.JsonNode json) Execute the test of the condition
-
Method Details
-
test
Execute the test of the condition- Parameters:
json- the json to test- Returns:
- a
Resultexplaining whether the condition was met and if not, why not
-
describe
String describe()Describe the condition- Returns:
- description of the condition
-
and
Add a second condition to this one using and logic. Short-circuits so the second condition only evaluated if the first is true- Parameters:
other- the other one- Returns:
- the combined condition
-
or
Add a second condition to this one using or logic. Short-circuits so the second condition only evaluated if the first is false- Parameters:
other- the other one- Returns:
- the combined condition
-
inverted
Invert the condition - i.e. wrap it in a not- Returns:
- the opposite of the condition
-