Class SimpleStringGenerator.Builder

java.lang.Object
io.bloviate.gen.AbstractBuilder<String>
io.bloviate.gen.SimpleStringGenerator.Builder
All Implemented Interfaces:
Builder<String>
Enclosing class:
SimpleStringGenerator

public static class SimpleStringGenerator.Builder extends AbstractBuilder<String>
Builder for SimpleStringGenerator instances.
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Constructs a new builder.
      Parameters:
      random - the seeded random generator backing the produced generator
  • Method Details

    • size

      public SimpleStringGenerator.Builder size(int size)
      Sets the fixed string length.
      Parameters:
      size - the number of characters in each generated string; capped at 2000 at generation time. Defaults to 10.
      Returns:
      this builder, for chaining
    • letters

      public SimpleStringGenerator.Builder letters(boolean letters)
      Controls whether ASCII letters (A-Za-z) are included in the character set.
      Parameters:
      letters - true to include letters. Defaults to true.
      Returns:
      this builder, for chaining
    • numbers

      public SimpleStringGenerator.Builder numbers(boolean numbers)
      Controls whether decimal digits (0-9) are included in the character set.
      Parameters:
      numbers - true to include digits. Defaults to false.
      Returns:
      this builder, for chaining
    • build

      public SimpleStringGenerator build()
      Description copied from interface: Builder
      Builds and returns a configured data generator.
      Returns:
      a new DataGenerator configured with the builder's settings