Class BitStringGenerator.Builder

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

public static class BitStringGenerator.Builder extends AbstractBuilder<String>
Fluent builder for BitStringGenerator.
  • 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

    • size

      public BitStringGenerator.Builder size(int size)
      Sets the requested number of bits. The generated length is this value clamped to [1, 25]. Defaults to 1.
      Parameters:
      size - the requested bit-string length
      Returns:
      this builder, for chaining
    • build

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