Class StaticStringGenerator.Builder

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

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

    • Builder

      public Builder(RandomGenerator random)
      Constructs a new builder. The random generator is required by the builder contract but is never consulted, since the generated value is constant.
      Parameters:
      random - the random generator (unused by this generator)
  • Method Details

    • value

      public StaticStringGenerator.Builder value(String value)
      Sets the constant value returned by every call to the generator.
      Parameters:
      value - the fixed string to emit. Defaults to the empty string "".
      Returns:
      this builder, for chaining
    • build

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