Class DateGenerator.Builder

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

public static class DateGenerator.Builder extends AbstractBuilder<Date>
Builder for DateGenerator instances.
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Constructs a new builder.
      Parameters:
      random - the seeded random generator backing the produced generator
  • Method Details

    • start

      public DateGenerator.Builder start(Date start)
      Sets the inclusive lower bound of the generated range.
      Parameters:
      start - the earliest possible date, inclusive. Defaults to the Unix epoch.
      Returns:
      this builder, for chaining
    • end

      public DateGenerator.Builder end(Date end)
      Sets the exclusive upper bound of the generated range.
      Parameters:
      end - the date one millisecond past the latest possible value, exclusive. Defaults to AbstractBuilder.DEFAULT_REFERENCE plus 100 days.
      Returns:
      this builder, for chaining
    • build

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