public class DslPart
Abstract base class to support Object and Array JSON DSL builders
public static java.lang.String HEXADECIMAL
public static java.lang.String IP_ADDRESS
public static java.lang.String UUID_REGEX
public static long DATE_2000
protected DslPart parent
protected java.lang.String rootPath
protected java.lang.String rootName
protected au.com.dius.pact.core.model.matchingrules.Category matchers
protected au.com.dius.pact.core.model.generators.Generators generators
protected boolean closed
public DslPart(DslPart parent, java.lang.String rootPath, java.lang.String rootName)
public DslPart(java.lang.String rootPath, java.lang.String rootName)
protected void putObject(DslPart object)
protected void putArray(DslPart object)
public java.lang.Object getBody()
public PactDslJsonArray array(java.lang.String name)
Field which is an array
name
- field namepublic PactDslJsonArray array()
Element as an array
public DslPart closeArray()
Close of the previous array element
public PactDslJsonBody arrayLike(java.lang.String name)
Array field where each element must match the following object
name
- field namepublic PactDslJsonBody arrayLike()
Array element where each element of the array must match the following object
public PactDslJsonBody eachLike(java.lang.String name)
Array field where each element must match the following object
name
- field namepublic PactDslJsonBody eachLike()
Array element where each element of the array must match the following object
public PactDslJsonBody eachLike(java.lang.String name, int numberExamples)
Array field where each element must match the following object
name
- field namenumberExamples
- number of examples to generatepublic PactDslJsonBody eachLike(int numberExamples)
Array element where each element of the array must match the following object
numberExamples
- number of examples to generatepublic PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size)
Array field with a minumum size and each element must match the provided object
name
- field namesize
- minimum sizepublic PactDslJsonBody minArrayLike(java.lang.Integer size)
Array element with a minumum size and each element of the array must match the provided object
size
- minimum sizepublic PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples)
Array field with a minumum size and each element must match the provided object
name
- field namesize
- minimum sizenumberExamples
- number of examples to generatepublic PactDslJsonBody minArrayLike(java.lang.Integer size, int numberExamples)
Array element with a minumum size and each element of the array must match the provided object
size
- minimum sizenumberExamples
- number of examples to generatepublic PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size)
Array field with a maximum size and each element must match the provided object
name
- field namesize
- maximum sizepublic PactDslJsonBody maxArrayLike(java.lang.Integer size)
Array element with a maximum size and each element of the array must match the provided object
size
- minimum sizepublic PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples)
Array field with a maximum size and each element must match the provided object
name
- field namesize
- maximum sizenumberExamples
- number of examples to generatepublic PactDslJsonBody maxArrayLike(java.lang.Integer size, int numberExamples)
Array element with a maximum size and each element of the array must match the provided object
size
- minimum sizenumberExamples
- number of examples to generatepublic PactDslJsonBody minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize)
Array field with a minimum and maximum size and each element must match the provided object
name
- field nameminSize
- minimum sizemaxSize
- maximum sizepublic PactDslJsonBody minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize)
Array element with a minimum and maximum size and each element of the array must match the provided object
minSize
- minimum sizemaxSize
- maximum sizepublic PactDslJsonBody minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples)
Array field with a minimum and maximum size and each element must match the provided object
name
- field nameminSize
- minimum sizemaxSize
- maximum sizenumberExamples
- number of examples to generatepublic PactDslJsonBody minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples)
Array element with a minimum and maximum size and each element of the array must match the provided object
minSize
- minimum sizemaxSize
- maximum sizenumberExamples
- number of examples to generatepublic PactDslJsonArray eachArrayLike(java.lang.String name)
Array field where each element is an array and must match the following object
name
- field namepublic PactDslJsonArray eachArrayLike()
Array element where each element of the array is an array and must match the following object
public PactDslJsonArray eachArrayLike(java.lang.String name, int numberExamples)
Array field where each element is an array and must match the following object
name
- field namenumberExamples
- number of examples to generatepublic PactDslJsonArray eachArrayLike(int numberExamples)
Array element where each element of the array is an array and must match the following object
numberExamples
- number of examples to generatepublic PactDslJsonArray eachArrayWithMaxLike(java.lang.String name, java.lang.Integer size)
Array field where each element is an array and must match the following object
name
- field namesize
- Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMaxLike(java.lang.Integer size)
Array element where each element of the array is an array and must match the following object
size
- Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMaxLike(java.lang.String name, int numberExamples, java.lang.Integer size)
Array field where each element is an array and must match the following object
name
- field namenumberExamples
- number of examples to generatesize
- Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMaxLike(int numberExamples, java.lang.Integer size)
Array element where each element of the array is an array and must match the following object
numberExamples
- number of examples to generatesize
- Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(java.lang.String name, java.lang.Integer size)
Array field where each element is an array and must match the following object
name
- field namesize
- Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(java.lang.Integer size)
Array element where each element of the array is an array and must match the following object
size
- Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(java.lang.String name, int numberExamples, java.lang.Integer size)
Array field where each element is an array and must match the following object
name
- field namenumberExamples
- number of examples to generatesize
- Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(int numberExamples, java.lang.Integer size)
Array element where each element of the array is an array and must match the following object
numberExamples
- number of examples to generatesize
- Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize)
Array field where each element is an array and must match the following object
name
- field nameminSize
- minimum sizemaxSize
- maximum sizepublic PactDslJsonArray eachArrayWithMinMaxLike(java.lang.Integer minSize, java.lang.Integer maxSize)
Array element where each element of the array is an array and must match the following object
minSize
- minimum sizemaxSize
- maximum sizepublic PactDslJsonArray eachArrayWithMinMaxLike(java.lang.String name, int numberExamples, java.lang.Integer minSize, java.lang.Integer maxSize)
Array field where each element is an array and must match the following object
name
- field namenumberExamples
- number of examples to generateminSize
- minimum sizemaxSize
- maximum sizepublic PactDslJsonArray eachArrayWithMinMaxLike(int numberExamples, java.lang.Integer minSize, java.lang.Integer maxSize)
Array element where each element of the array is an array and must match the following object
numberExamples
- number of examples to generateminSize
- minimum sizemaxSize
- maximum sizepublic PactDslJsonBody object(java.lang.String name)
Object field
name
- field namepublic PactDslJsonBody object()
Object element
public DslPart closeObject()
Close off the previous object
public au.com.dius.pact.core.model.matchingrules.Category getMatchers()
public void setMatchers(au.com.dius.pact.core.model.matchingrules.Category matchers)
protected au.com.dius.pact.core.model.matchingrules.RegexMatcher regexp(java.lang.String regex)
protected au.com.dius.pact.core.model.matchingrules.TimestampMatcher matchTimestamp(java.lang.String format)
protected au.com.dius.pact.core.model.matchingrules.DateMatcher matchDate(java.lang.String format)
protected au.com.dius.pact.core.model.matchingrules.TimeMatcher matchTime(java.lang.String format)
protected au.com.dius.pact.core.model.matchingrules.MinTypeMatcher matchMin(java.lang.Integer min)
protected au.com.dius.pact.core.model.matchingrules.MaxTypeMatcher matchMax(java.lang.Integer max)
protected au.com.dius.pact.core.model.matchingrules.MinMaxTypeMatcher matchMinMax(java.lang.Integer minSize, java.lang.Integer maxSize)
protected au.com.dius.pact.core.model.matchingrules.IncludeMatcher includesMatcher(java.lang.Object value)
public PactDslJsonBody asBody()
public PactDslJsonArray asArray()
public DslPart close()
This closes off the object graph build from the DSL in case any close[Object|Array] methods have not been called.
public au.com.dius.pact.core.model.generators.Generators getGenerators()
public void setGenerators(au.com.dius.pact.core.model.generators.Generators generators)
public DslPart getParent()
Returns the parent of this part (object or array)