Package org.instancio.generator.specs
Interface ArrayGeneratorSpec<T>
- Type Parameters:
T
- array type
- All Superinterfaces:
GeneratorSpec<T>
,NullableGeneratorSpec<T>
,SubtypeGeneratorSpec<T>
Generator spec for arrays.
-
Method Summary
Modifier and TypeMethodDescriptionlength
(int length) length of array to generate.maxLength
(int length) Maximum length of array to generate.minLength
(int length) Minimum length of array to generate.nullable()
Indicates thatnull
value can be generated for the array.Indicates thatnull
values can be generated for array elements.Specifies the type of array that should be generated.Adds given elements to the generated array at random positions.
-
Method Details
-
length
length of array to generate.- Parameters:
length
- of array- Returns:
- spec builder
-
minLength
Minimum length of array to generate.- Parameters:
length
- minimum length (inclusive)- Returns:
- spec builder
-
maxLength
Maximum length of array to generate.- Parameters:
length
- maximum length (inclusive)- Returns:
- spec builder
-
nullable
ArrayGeneratorSpec<T> nullable()Indicates thatnull
value can be generated for the array.- Specified by:
nullable
in interfaceNullableGeneratorSpec<T>
- Returns:
- spec builder
-
nullableElements
ArrayGeneratorSpec<T> nullableElements()Indicates thatnull
values can be generated for array elements.- Returns:
- spec builder
-
subtype
Specifies the type of array that should be generated.- Specified by:
subtype
in interfaceSubtypeGeneratorSpec<T>
- Parameters:
type
- of array to generate- Returns:
- spec builder
- Since:
- 1.4.0
-
with
Adds given elements to the generated array at random positions.- Parameters:
elements
- to add- Returns:
- spec builder
-