Class IntegerGenerator.Builder

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

public static class IntegerGenerator.Builder extends AbstractBuilder<Integer>
Fluent builder for IntegerGenerator.
  • 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 IntegerGenerator.Builder start(int 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 IntegerGenerator.Builder end(int end)
      Sets the exclusive upper bound of the generated range. Defaults to Integer.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 IntegerGenerator build()
      Description copied from interface: Builder
      Builds and returns a configured data generator.
      Returns:
      a new DataGenerator configured with the builder's settings