Class StaticIntegerGenerator.Builder

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

public static class StaticIntegerGenerator.Builder extends AbstractBuilder<Integer>
Fluent builder for StaticIntegerGenerator.
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Creates a builder backed by the given random source. The source is never used, since this generator always returns the configured value.
      Parameters:
      random - the (unused) random source
  • Method Details

    • value

      Sets the fixed value returned by every call to generate(). Defaults to 0.
      Parameters:
      value - the constant value to generate
      Returns:
      this builder, for chaining
    • build

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