Class LongGenerator.Builder

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

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