{
11 | /**
12 | * Depending on the type of node, this will detect emptiness.
13 | * Warning! this is best used prefixed with a type assertion so know we have
14 | * a {@link Sizeable} item in the node. E.g. assertJson(json).at("/field").array().isEmpty();
15 | * @return the {@link CoreJsonAssertion} for fluent assertions, with this condition added
16 | */
17 | default A isEmpty() {
18 | return satisfies(new IsEmpty());
19 | }
20 |
21 | /**
22 | * Depending on the type of node, this will detect the opposite of emptiness. At this level it
23 | * is specifically the inverse of an empty collection, object or string.
24 | * Warning! this is best used prefixed with a type assertion so know we have
25 | * a {@link Sizeable} item in the node. E.g. assertJson(json).at("/field").array().isNotEmpty();
26 | * @return the {@link CoreJsonAssertion} for fluent assertions, with this condition added
27 | */
28 | default A isNotEmpty() {
29 | return satisfies(not(new IsEmpty()));
30 | }
31 |
32 | /**
33 | * Depending on the type of node, this will detect size
34 | * @return the {@link CoreJsonAssertion} for fluent assertions, with this condition added
35 | */
36 | default A hasSize(int expected) {
37 | return satisfies(new HasSize(expected));
38 | }
39 |
40 | /**
41 | * Requiring this node to be a sizeable node, this switches to {@link NumberComparisonDsl}
42 | * to allow criteria to be specified for the size.
43 | * @return the {@link CoreJsonAssertion} for fluent assertions, with this condition added
44 | */
45 | default NumberComparisonDsl