- Type Parameters:
V - the type of value
- All Implemented Interfaces:
Condition
Specific typed "hasValue" comparison
-
Constructor Summary
Constructors
-
Method Summary
test(com.fasterxml.jackson.databind.JsonNode json)
Execute the test of the condition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
HasValue
public HasValue(Function<com.fasterxml.jackson.databind.JsonNode,V> valueExtractor,
V expected)
Construct the condition
- Parameters:
valueExtractor - how to extract the right sort of value from the JsonNode
expected - the expected value
-
Method Details
-
test
public Result test(com.fasterxml.jackson.databind.JsonNode json)
Execute the test of the condition
- Specified by:
test in interface Condition
- Parameters:
json - the json to test
- Returns:
- a
Result explaining whether the condition was met and if not, why not
-
describe
Describe the condition
- Specified by:
describe in interface Condition
- Returns:
- description of the condition