Class WhereDsl<A>
java.lang.Object
uk.org.webcompere.modelassert.json.dsl.nodespecific.tree.WhereDsl<A>
- Type Parameters:
A- the type of assertion this belongs to
- All Implemented Interfaces:
IsEqualToDsl<A>
The DSL for the Where Context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAllow arrays to just contain the other elements rather than match completelyRelax the ordering requirement for an array, everywhereProvide a path using the JSON Pointer syntax - i.e.configuredBy(UnaryOperator<WhereDsl<A>> configurer) Add common configuration to the where dslisEqualTo(TreeComparisonCondition condition) Terminal statement - apply the final comparison condition to the assertion.isNotEqualTo(TreeComparisonCondition condition) Terminal statement - apply the final comparison condition to the assertion.Relax the key ordering constraint for everywhereAllow missing keys in objectsEnter the path context - specialising a rule for the given path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.tree.IsEqualToDsl
isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualToYaml, isEqualToYaml, isEqualToYaml, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualToYaml, isNotEqualToYaml, isNotEqualToYaml
-
Constructor Details
-
WhereDsl
Construct with the assertion to return to- Parameters:
coreAssertion- the core assertion, as expressed by itsSatisfiesentry point
-
-
Method Details
-
keysInAnyOrder
Relax the key ordering constraint for everywhere- Returns:
thisfor fluent calling
-
objectContains
Allow missing keys in objects- Returns:
thisfor fluent calling
-
arrayInAnyOrder
Relax the ordering requirement for an array, everywhere- Returns:
thisfor fluent calling
-
arrayContains
Allow arrays to just contain the other elements rather than match completely- Returns:
thisfor fluent calling
-
configuredBy
Add common configuration to the where dsl- Parameters:
configurer- the configurer to use- Returns:
- the
WhereDslfor further customisation
-
path
Enter the path context - specialising a rule for the given path. The path is a list of node ids or wildcards leading from the root element up to some part of the tree we're going to specialise. This is useful for mixing named fields or array indices withPathWildCards likePathWildCard.ANYorPathWildCard.ANY_SUBTREE, but can be long winded for when there's a fixed path, and doesn't allow for expressing a rule on root. There's alsoat(String)which will allow a root path -"/"- Parameters:
pathStart- the first String,PathWildCardorPatternpathRemainder- the remaining String,PathWildCardorPatterns- Returns:
- the
PathDslto complete specialising what to do at that path instead of the defaults
-
at
Provide a path using the JSON Pointer syntax - i.e. no wildcards or regular expressions used. Note: this allows for matching to the root object with a path of"/"- Parameters:
jsonPointer- the json pointer expression- Returns:
- the
PathDslto complete specialising what to do at that path instead of the defaults
-
isEqualTo
Description copied from interface:IsEqualToDslTerminal statement - apply the final comparison condition to the assertion. Called internally.- Specified by:
isEqualToin interfaceIsEqualToDsl<A>- Parameters:
condition- the condition- Returns:
- the assertion for fluent comparison
-
isNotEqualTo
Description copied from interface:IsEqualToDslTerminal statement - apply the final comparison condition to the assertion. Called internally.- Specified by:
isNotEqualToin interfaceIsEqualToDsl<A>- Parameters:
condition- the condition- Returns:
- the assertion for fluent comparison
-