Class LambdaDslJsonArray

java.lang.Object
au.com.dius.pact.consumer.dsl.LambdaDslJsonArray

public class LambdaDslJsonArray extends Object
  • Method Details

    • getPactDslJsonArray

      public au.com.dius.pact.consumer.dsl.PactDslJsonArray getPactDslJsonArray()
      Get the raw PactDslJsonArray which is abstracted with PactDslJsonArray
    • object

      Element that is a JSON object
    • array

      Element that is a JSON array
    • unorderedArray

      public LambdaDslJsonArray unorderedArray(Consumer<LambdaDslJsonArray> a)
      Array element where order is ignored
    • unorderedMinArray

      public LambdaDslJsonArray unorderedMinArray(int size, Consumer<LambdaDslJsonArray> a)
      Array element of min size where order is ignored
      Parameters:
      size -
    • unorderedMaxArray

      public LambdaDslJsonArray unorderedMaxArray(int size, Consumer<LambdaDslJsonArray> a)
      Array element of max size where order is ignored
      Parameters:
      size -
    • unorderedMinMaxArray

      public LambdaDslJsonArray unorderedMinMaxArray(int minSize, int maxSize, Consumer<LambdaDslJsonArray> a)
      Array element of min and max size where order is ignored
      Parameters:
      minSize -
      maxSize -
    • stringValue

      public LambdaDslJsonArray stringValue(String value)
      Element that must be the specified value
      Parameters:
      value - string value
    • stringType

      public LambdaDslJsonArray stringType(String example)
      Element that can be any string
      Parameters:
      example - example value to use for generated bodies
    • stringMatcher

      public LambdaDslJsonArray stringMatcher(String regex, String example)
      Element that must match the regular expression
      Parameters:
      regex - regular expression
      example - example value to use for generated bodies
    • numberValue

      public LambdaDslJsonArray numberValue(Number value)
      Element that must be the specified number
      Parameters:
      value - number value
    • numberType

      public LambdaDslJsonArray numberType(Number example)
      Element that can be any number
      Parameters:
      example - example number to use for generated bodies
    • integerType

      public LambdaDslJsonArray integerType()
      Element that must be an integer
    • integerType

      public LambdaDslJsonArray integerType(Long example)
      Element that must be an integer
      Parameters:
      example - example integer value to use for generated bodies
    • decimalType

      public LambdaDslJsonArray decimalType()
      Element that must be a decimal value
    • decimalType

      public LambdaDslJsonArray decimalType(BigDecimal example)
      Element that must be a decimalType value
      Parameters:
      example - example decimalType value
    • decimalType

      public LambdaDslJsonArray decimalType(Double example)
      Attribute that must be a decimalType value
      Parameters:
      example - example decimalType value
    • numberMatching

      public LambdaDslJsonArray numberMatching(String regex, Number example)
      Attribute that can be any number and which must match the provided regular expression
      Parameters:
      regex - Regular expression that the numbers string form must match
      example - example number to use for generated bodies
    • decimalMatching

      public LambdaDslJsonArray decimalMatching(String regex, Double example)
      Attribute that can be any number decimal number (has significant digits after the decimal point) and which must match the provided regular expression
      Parameters:
      regex - Regular expression that the numbers string form must match
      example - example number to use for generated bodies
    • integerMatching

      public LambdaDslJsonArray integerMatching(String regex, Integer example)
      Attribute that can be any integer and which must match the provided regular expression
      Parameters:
      regex - Regular expression that the numbers string form must match
      example - example integer to use for generated bodies
    • booleanValue

      public LambdaDslJsonArray booleanValue(Boolean value)
      Element that must be the specified value
      Parameters:
      value - boolean value
    • booleanType

      public LambdaDslJsonArray booleanType(Boolean example)
      Element that must be a boolean
      Parameters:
      example - example boolean to use for generated bodies
    • date

      public LambdaDslJsonArray date()
      Element that must be formatted as an ISO date
    • date

      public LambdaDslJsonArray date(String format)
      Element that must match the provided date format
      Parameters:
      format - date format to match
    • date

      public LambdaDslJsonArray date(String format, Date example)
      Element that must match the provided date format
      Parameters:
      format - date format to match
      example - example date to use for generated values
    • time

      public LambdaDslJsonArray time()
      Element that must be an ISO formatted time
    • time

      public LambdaDslJsonArray time(String format)
      Element that must match the given time format
      Parameters:
      format - time format to match
    • time

      public LambdaDslJsonArray time(String format, Date example)
      Element that must match the given time format
      Parameters:
      format - time format to match
      example - example time to use for generated bodies
    • timestamp

      @Deprecated public LambdaDslJsonArray timestamp()
      Deprecated.
      Use datetime
      Element that must be an ISO formatted timestamp
    • timestamp

      @Deprecated public LambdaDslJsonArray timestamp(String format)
      Deprecated.
      Use datetime
      Element that must match the given timestamp format
      Parameters:
      format - timestamp format
    • timestamp

      @Deprecated public LambdaDslJsonArray timestamp(String format, Date example)
      Deprecated.
      Use datetime
      Element that must match the given timestamp format
      Parameters:
      format - timestamp format
      example - example date and time to use for generated bodies
    • timestamp

      @Deprecated public LambdaDslJsonArray timestamp(String format, Instant example)
      Deprecated.
      Use datetime
      Element that must match the given timestamp format
      Parameters:
      format - timestamp format
      example - example date and time to use for generated bodies
    • id

      public LambdaDslJsonArray id()
      Element that must be a numeric identifier
    • id

      public LambdaDslJsonArray id(Long example)
      Element that must be a numeric identifier
      Parameters:
      example - example id to use for generated bodies
    • uuid

      public LambdaDslJsonArray uuid()
      Element that must be encoded as an UUID
    • uuid

      public LambdaDslJsonArray uuid(String example)
      Element that must be encoded as an UUID
      Parameters:
      example - example UUID to use for generated bodies
    • hexValue

      public LambdaDslJsonArray hexValue()
      Element that must be encoded as a hexadecimal value
    • hexValue

      public LambdaDslJsonArray hexValue(String example)
      Element that must be encoded as a hexadecimal value
      Parameters:
      example - example value to use for generated bodies
    • ipV4Address

      public LambdaDslJsonArray ipV4Address()
      Element that must be an IP4 address
    • and

      public LambdaDslJsonArray and(Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
      Combine all the matchers using AND
      Parameters:
      value - Attribute example value
      rules - Matching rules to apply
    • or

      public LambdaDslJsonArray or(Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
      Combine all the matchers using OR
      Parameters:
      value - Attribute example value
      rules - Matching rules to apply
    • eachLike

      public LambdaDslJsonArray eachLike(Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array where each item must match the following example
    • eachLike

      public LambdaDslJsonArray eachLike(au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value)
      Element that is an array where each item must match the following example
      Parameters:
      value - Value that each item in the array must match
    • eachLike

      public LambdaDslJsonArray eachLike(au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value, int numberExamples)
      Element that is an array where each item must match the following example
      Parameters:
      value - Value that each item in the array must match
      numberExamples - Number of examples to generate
    • eachLike

      public LambdaDslJsonArray eachLike(int numberExamples, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array where each item must match the following example
      Parameters:
      numberExamples - Number of examples to generate
    • minArrayLike

      public LambdaDslJsonArray minArrayLike(Integer size, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array with a minimum size where each item must match the following example
      Parameters:
      size - minimum size of the array
    • minArrayLike

      public LambdaDslJsonArray minArrayLike(Integer size, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array with a minimum size where each item must match the following example
      Parameters:
      size - minimum size of the array
      numberExamples - number of examples to generate
    • maxArrayLike

      public LambdaDslJsonArray maxArrayLike(Integer size, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array with a maximum size where each item must match the following example
      Parameters:
      size - maximum size of the array
    • maxArrayLike

      public LambdaDslJsonArray maxArrayLike(Integer size, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array with a maximum size where each item must match the following example
      Parameters:
      size - maximum size of the array
      numberExamples - number of examples to generate
    • minMaxArrayLike

      public LambdaDslJsonArray minMaxArrayLike(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array with a minimum and maximum size where each item must match the following example
      Parameters:
      minSize - minimum size of the array
      maxSize - maximum size of the array
    • minMaxArrayLike

      public LambdaDslJsonArray minMaxArrayLike(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject)
      Element that is an array with a minimum and maximum size where each item must match the following example
      Parameters:
      minSize - minimum size of the array
      maxSize - maximum size of the array
      numberExamples - number of examples to generate
    • nullValue

      public LambdaDslJsonArray nullValue()
      Adds a null value to the list
    • eachArrayLike

      public LambdaDslJsonArray eachArrayLike(Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object
    • eachArrayLike

      public LambdaDslJsonArray eachArrayLike(int numberExamples, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object
      Parameters:
      numberExamples - number of examples to generate
    • eachArrayWithMaxLike

      public LambdaDslJsonArray eachArrayWithMaxLike(Integer size, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object. This will generate 1 example value, if you want to change that number use eachArrayWithMaxLike(int, Integer, Consumer)
      Parameters:
      size - Maximum size of the outer array
    • eachArrayWithMaxLike

      public LambdaDslJsonArray eachArrayWithMaxLike(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object
      Parameters:
      numberExamples - number of examples to generate
      size - Maximum size of the outer array
    • eachArrayWithMinLike

      public LambdaDslJsonArray eachArrayWithMinLike(Integer size, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object. This will generate 1 example value, if you want to change that number use eachArrayWithMinLike(int, Integer, Consumer)
      Parameters:
      size - Minimum size of the outer array
    • eachArrayWithMinLike

      public LambdaDslJsonArray eachArrayWithMinLike(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object
      Parameters:
      numberExamples - number of examples to generate
      size - Minimum size of the outer array
    • eachArrayWithMinMaxLike

      public LambdaDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object. This will generate 1 example value, if you want to change that number use eachArrayWithMinMaxLike(Integer, Integer, int, Consumer)
      Parameters:
      minSize - minimum size
      maxSize - maximum size
    • eachArrayWithMinMaxLike

      public LambdaDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray)
      Array element where each element of the array is an array and must match the following object
      Parameters:
      minSize - minimum size
      maxSize - maximum size
    • dateExpression

      public LambdaDslJsonArray dateExpression(String expression)
      Date value generated from the provided expression. Will use an ISO format.
      Parameters:
      expression - Date expression
    • dateExpression

      public LambdaDslJsonArray dateExpression(String expression, String format)
      Date value generated from the provided expression
      Parameters:
      expression - Date expression
      format - Date format to use for values
    • timeExpression

      public LambdaDslJsonArray timeExpression(String expression)
      Time value generated from the provided expression. Will use an ISO format.
      Parameters:
      expression - Time expression
    • timeExpression

      public LambdaDslJsonArray timeExpression(String expression, String format)
      Time value generated from the provided expression
      Parameters:
      expression - Time expression
      format - Time format to use for values
    • datetimeExpression

      public LambdaDslJsonArray datetimeExpression(String expression)
      Datetime generated from the provided expression. Will use an ISO format.
      Parameters:
      expression - Datetime expression
    • datetimeExpression

      public LambdaDslJsonArray datetimeExpression(String expression, String format)
      Datetime generated from the provided expression
      Parameters:
      expression - Datetime expression
      format - Datetime format to use for values
    • build

      public au.com.dius.pact.consumer.dsl.DslPart build()