Package org.instancio.generator.hints
Class ArrayHint.Builder
java.lang.Object
org.instancio.generator.hints.ArrayHint.Builder
- Enclosing class:
ArrayHint
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the object.static ArrayHint.Builder
builder()
nullableElements
(boolean nullableElements) Indicates whethernull
elements are allowed to be generated.shuffle
(boolean shuffle) Indicates whether array elements, once populated, should be randomly shuffled.withElements
(List<? extends T> elements) Additional elements to be inserted into the array by the engine during the population process.
-
Method Details
-
builder
-
nullableElements
Indicates whethernull
elements are allowed to be generated.- Parameters:
nullableElements
- iftrue
,null
elements allowed- Returns:
- builder instance
- Since:
- 2.0.0
-
shuffle
Indicates whether array elements, once populated, should be randomly shuffled. The shuffle implementation ensures that results are reproducible per given seed.- Parameters:
shuffle
- iftrue
, elements will be shuffled- Returns:
- builder instance
- Since:
- 2.0.0
-
withElements
Additional elements to be inserted into the array by the engine during the population process. This method can be invoked more than once.- Type Parameters:
T
- element type- Parameters:
elements
- elements to be inserted into the array in addition to the random elements generated by the engine- Returns:
- builder instance
- Since:
- 2.0.0
-
build
Builds the object.- Returns:
- the built instance.
-