/** * Closes the current array */ @Override public DslPart closeArray() { if (parent instanceof PactDslJsonArray) { closeObject(); return parent.closeArray(); } else { throw new UnsupportedOperationException("can't call closeArray on an Object"); } }
/** * Closes the current array */ @Override public DslPart closeArray() { if (parent instanceof PactDslJsonArray) { closeObject(); return parent.closeArray(); } else { throw new UnsupportedOperationException("can't call closeArray on an Object"); } }
public LambdaDslJsonArray eachArrayLike(int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayLike(numberExamples); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayWithMaxLike(String name, int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayWithMaxLike(name, numberExamples, size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayWithMinLike(String name, Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayWithMinLike(name, size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayWithMinLike(String name, int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayWithMinLike(name, numberExamples, size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayLike(Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayLike(); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayLike(String name, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayLike(name); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayWithMaxLike(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayWithMaxLike(numberExamples, size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayWithMinLike(Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayWithMinLike(size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayWithMinMaxLike(numberExamples, minSize, maxSize); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayLike(String name, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayLike(name, numberExamples); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayWithMinMaxLike(name, minSize, maxSize); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslObject eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayWithMinMaxLike(name, numberExamples, minSize, maxSize); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayWithMaxLike(Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayWithMaxLike(size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayWithMinMaxLike(minSize, maxSize); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
@Override public DslPart close() { DslPart parentToReturn = this; if (!closed) { DslPart parent = closeObject(); while (parent != null) { parentToReturn = parent; if (parent instanceof PactDslJsonArray) { parent = parent.closeArray(); } else { parent = parent.closeObject(); } } } return parentToReturn; }
public LambdaDslObject eachArrayWithMaxLike(String name, Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = object.eachArrayWithMaxLike(name, size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
public LambdaDslJsonArray eachArrayWithMinLike(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) { final PactDslJsonArray arrayLike = pactArray.eachArrayWithMinLike(numberExamples, size); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(arrayLike); nestedArray.accept(dslArray); arrayLike.closeArray().closeArray(); return this; }
/** * Accepts any key, and each key is mapped to a list of items that must match the following object definition. * Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verified. * * @param exampleKey Example key to use for generating bodies */ public LambdaDslObject eachKeyMappedToAnArrayLike(String exampleKey, Consumer<LambdaDslObject> nestedObject) { final PactDslJsonBody objectLike = object.eachKeyMappedToAnArrayLike(exampleKey); final LambdaDslObject dslObject = new LambdaDslObject(objectLike); nestedObject.accept(dslObject); objectLike.closeObject().closeArray(); return this; }