Class StringArrayGenerator.Builder
- Enclosing class:
StringArrayGenerator
Fluent builder for
StringArrayGenerator.-
Field Summary
Fields inherited from class AbstractBuilder
DEFAULT_REFERENCE, random -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(RandomGenerator random) Creates a builder backed by the given seeded random source. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a configured data generator.elementLength(int elementLength) Sets the character length of each generated string element.length(int length) Sets the number of elements in the generated array.
-
Constructor Details
-
Builder
Creates a builder backed by the given seeded random source.- Parameters:
random- the random source used to draw generated values
-
-
Method Details
-
length
Sets the number of elements in the generated array. Defaults to3.- Parameters:
length- the array length- Returns:
- this builder, for chaining
-
elementLength
Sets the character length of each generated string element. Defaults to10.- Parameters:
elementLength- the number of alphabetic characters per element- Returns:
- this builder, for chaining
-
build
Description copied from interface:BuilderBuilds and returns a configured data generator.- Returns:
- a new
DataGeneratorconfigured with the builder's settings
-