Class CompositeKeyComponentGenerator.Builder

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

public static class CompositeKeyComponentGenerator.Builder extends AbstractBuilder<Integer>
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Creates a builder.
      Parameters:
      random - the random source (unused by this generator, but required by the contract)
  • Method Details

    • start

      public CompositeKeyComponentGenerator.Builder start(int start)
      The first (lowest) value this dimension takes, inclusive — the start term in start + ((rowIndex / repeat) % cycle). It is the value emitted for row 0, and the dimension then ranges over [start, start + cycle). Defaults to 1.
      Parameters:
      start - the first value of this dimension, inclusive
      Returns:
      this builder, for chaining
    • repeat

      public CompositeKeyComponentGenerator.Builder repeat(long repeat)
      How many consecutive rows share this dimension's value before it advances — the repeat term in start + ((rowIndex / repeat) % cycle). It must equal the product of the sizes (cycles) of all dimensions nested inside this one (use 1 for the innermost dimension). Defaults to 1.
      Parameters:
      repeat - the number of consecutive rows per value (product of inner dimension sizes)
      Returns:
      this builder, for chaining
    • cycle

      public CompositeKeyComponentGenerator.Builder cycle(int cycle)
      This dimension's cardinality — how many distinct values it takes before wrapping back to start; the cycle term in start + ((rowIndex / repeat) % cycle). Defaults to 1.
      Parameters:
      cycle - the number of distinct values (size) of this dimension
      Returns:
      this builder, for chaining
    • build

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