Class DoubleGenerator.Builder

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

public static class DoubleGenerator.Builder extends AbstractBuilder<Double>
Fluent builder for DoubleGenerator.
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Creates a builder backed by the given seeded random source.
      Parameters:
      random - the random source used to draw generated values
  • Method Details

    • start

      public DoubleGenerator.Builder start(double start)
      Sets the inclusive lower bound of the generated range. Defaults to 0.
      Parameters:
      start - the smallest value that may be generated (inclusive)
      Returns:
      this builder, for chaining
    • end

      public DoubleGenerator.Builder end(double end)
      Sets the exclusive upper bound of the generated range. Defaults to Double.MAX_VALUE; generated values are always strictly less than this bound.
      Parameters:
      end - the upper bound that may never be generated (exclusive)
      Returns:
      this builder, for chaining
    • build

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