Class StaticDoubleGenerator.Builder

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

public static class StaticDoubleGenerator.Builder extends AbstractBuilder<Double>
Fluent builder for StaticDoubleGenerator.
  • 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

      public StaticDoubleGenerator.Builder value(Double 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 StaticDoubleGenerator build()
      Description copied from interface: Builder
      Builds and returns a configured data generator.
      Returns:
      a new DataGenerator configured with the builder's settings