Class ArrayContains
java.lang.Object
uk.org.webcompere.modelassert.json.condition.ArrayContains
- All Implemented Interfaces:
Condition
Array content conditions
-
Constructor Summary
ConstructorsConstructorDescriptionArrayContains(String description, List<Condition> arrayElementConditions, boolean requireStrict) Construct the array contains condition -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayContainscontainsValues(Object first, Object... rest) Create the condition to match the provided values in the arraystatic ArrayContainscontainsValues(ConditionList conditions) Create the condition to match the provided conditions in the arraystatic ArrayContainscontainsValuesExactly(Object first, Object... rest) Create the condition to match the provided values in the array in exact orderstatic ArrayContainscontainsValuesExactly(ConditionList conditions) Create the condition to match the provided condition list in the array in exact orderdescribe()Describe the conditiontest(com.fasterxml.jackson.databind.JsonNode json) Execute the test of the condition
-
Constructor Details
-
ArrayContains
public ArrayContains(String description, List<Condition> arrayElementConditions, boolean requireStrict) Construct the array contains condition- Parameters:
description- the name to use - as simple as possiblearrayElementConditions- the per element conditionsrequireStrict- whether the conditions are executed in strict order
-
-
Method Details
-
containsValues
Create the condition to match the provided values in the array- Parameters:
first- first valuerest- remaining values- Returns:
- the
ArrayContainsto find these values within the array
-
containsValues
Create the condition to match the provided conditions in the array- Parameters:
conditions- the conditions- Returns:
- the
ArrayContainsto find elements matching these conditions
-
containsValuesExactly
Create the condition to match the provided values in the array in exact order- Parameters:
first- first valuerest- remaining values- Returns:
- the
ArrayContainsto match the array with these values
-
containsValuesExactly
Create the condition to match the provided condition list in the array in exact order- Parameters:
conditions- conditions- Returns:
- the
ArrayContainsto match the array with these conditions
-
test
Execute the test of the condition -
describe
Describe the condition
-