java.lang.Object
uk.org.webcompere.modelassert.json.dsl.nodespecific.tree.PathDsl<A>
Type Parameters:
A - the overall type of assertion
All Implemented Interfaces:
JsonNodeAssertDsl<WhereDsl<A>>, ArrayNodeDsl<WhereDsl<A>>, BooleanNodeDsl<WhereDsl<A>>, NumberComparisonDsl<WhereDsl<A>>, NumberNodeDsl<WhereDsl<A>>, ObjectNodeDsl<WhereDsl<A>>, Sizeable<WhereDsl<A>>, TextNodeDsl<WhereDsl<A>>, IsEqualToDsl<WhereDsl<A>>, TreeComparisonDsl<WhereDsl<A>>, Satisfies<WhereDsl<A>>

public class PathDsl<A> extends Object implements JsonNodeAssertDsl<WhereDsl<A>>
Path DSL context within the WhereDsl
  • Method Details

    • fromJsonPointer

      public static <A> PathDsl<A> fromJsonPointer(WhereDsl<A> where, String jsonPointer)
      Create a path DSL from a JSON Pointer expression. Note: this allows for matching to the root object with a path of "/"
      Type Parameters:
      A - the type of assertion
      Parameters:
      where - the parent where
      jsonPointer - the pointer expression
      Returns:
      a new PathDsl for adding configuration to
    • satisfies

      public WhereDsl<A> satisfies(Condition condition)
      Description copied from interface: Satisfies
      Add a condition that the input JSON must satisfy
      Specified by:
      satisfies in interface Satisfies<A>
      Parameters:
      condition - the condition
      Returns:
      this for fluent calling
    • keysInAnyOrder

      public WhereDsl<A> keysInAnyOrder()
      Add a TreeRule.IGNORE_KEY_ORDER to the clause
      Returns:
      the WhereDsl for fluent calling with the path added
    • keysInOrder

      public WhereDsl<A> keysInOrder()
      Add a TreeRule.REQUIRE_KEY_ORDER to the path - this can't be done in WhereDsl as it is already the default so wouldn't mean anything
      Returns:
      the WhereDsl for fluent calling with the path added
    • objectContains

      public WhereDsl<A> objectContains()
      Allow missing keys in objects
      Returns:
      the WhereDsl for fluent calling with the path added
    • arrayInAnyOrder

      public WhereDsl<A> arrayInAnyOrder()
      Relax the ordering requirement for an array at this position in the tree
      Returns:
      this for fluent calling
    • arrayContains

      public WhereDsl<A> arrayContains()
      Allow the array at this position in the tree to just contain the other elements rather than match it completely
      Returns:
      this for fluent calling
    • isIgnored

      public WhereDsl<A> isIgnored()
      Ignore everything at this path
      Returns:
      the WhereDsl for fluent calling, with this path ignored