Interface ArrayGeneratorSpec<T>

Type Parameters:
T - array type
All Superinterfaces:
GeneratorSpec<T>, NullableGeneratorSpec<T>, SubtypeGeneratorSpec<T>

public interface ArrayGeneratorSpec<T> extends NullableGeneratorSpec<T>, SubtypeGeneratorSpec<T>
Generator spec for arrays.
  • Method Details

    • length

      ArrayGeneratorSpec<T> length(int length)
      length of array to generate.
      Parameters:
      length - of array
      Returns:
      spec builder
    • minLength

      ArrayGeneratorSpec<T> minLength(int length)
      Minimum length of array to generate.
      Parameters:
      length - minimum length (inclusive)
      Returns:
      spec builder
    • maxLength

      ArrayGeneratorSpec<T> maxLength(int length)
      Maximum length of array to generate.
      Parameters:
      length - maximum length (inclusive)
      Returns:
      spec builder
    • nullable

      ArrayGeneratorSpec<T> nullable()
      Indicates that null value can be generated for the array.
      Specified by:
      nullable in interface NullableGeneratorSpec<T>
      Returns:
      spec builder
    • nullableElements

      ArrayGeneratorSpec<T> nullableElements()
      Indicates that null values can be generated for array elements.
      Returns:
      spec builder
    • subtype

      ArrayGeneratorSpec<T> subtype(Class<?> type)
      Specifies the type of array that should be generated.
      Specified by:
      subtype in interface SubtypeGeneratorSpec<T>
      Parameters:
      type - of array to generate
      Returns:
      spec builder
      Since:
      1.4.0
    • with

      ArrayGeneratorSpec<T> with(T... elements)
      Adds given elements to the generated array at random positions.
      Parameters:
      elements - to add
      Returns:
      spec builder