Class VariableStringGenerator.Builder
- Enclosing class:
VariableStringGenerator
Builder for
VariableStringGenerator instances.-
Field Summary
Fields inherited from class AbstractBuilder
DEFAULT_REFERENCE, random -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a configured data generator.letters(boolean letters) Controls whether ASCII letters (A-Za-z) are included in the character set.maxLength(int maxLength) Sets the inclusive upper bound of the random length range.minLength(int minLength) Sets the inclusive lower bound of the random length range.numbers(boolean numbers) Controls whether decimal digits (0-9) are included in the character set.
-
Constructor Details
-
Builder
Constructs a new builder.- Parameters:
random- the seeded random generator backing the produced generator
-
-
Method Details
-
minLength
Sets the inclusive lower bound of the random length range.- Parameters:
minLength- the minimum string length; effectively clamped up to1at generation time (lengths below 1 are treated as 1). Defaults to1.- Returns:
- this builder, for chaining
-
maxLength
Sets the inclusive upper bound of the random length range.- Parameters:
maxLength- the maximum string length, inclusive. Defaults to10.- Returns:
- this builder, for chaining
-
letters
Controls whether ASCII letters (A-Za-z) are included in the character set.- Parameters:
letters-trueto include letters. Defaults totrue.- Returns:
- this builder, for chaining
-
numbers
Controls whether decimal digits (0-9) are included in the character set.- Parameters:
numbers-trueto include digits. Defaults tofalse.- 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
-