Class NormalIntegerGenerator.Builder

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

public static class NormalIntegerGenerator.Builder extends AbstractBuilder<Integer>
Builds a NormalIntegerGenerator, defaulting to a standard normal distribution (mean 0, standard deviation 1) spanning the full int range.
Since:
2.11.0
  • Constructor Details

    • Builder

      public Builder(RandomGenerator random)
      Creates a builder drawing from the given random source.
      Parameters:
      random - the random source backing the generated values
  • Method Details

    • mean

      public NormalIntegerGenerator.Builder mean(double mean)
      Sets the distribution mean (center); kept as a double so the center may sit between integers. Returns this builder for chaining.
      Parameters:
      mean - the mean of the normal distribution
      Returns:
      this builder
    • standardDeviation

      public NormalIntegerGenerator.Builder standardDeviation(double standardDeviation)
      Sets the distribution standard deviation (spread); must be non-negative. Returns this builder for chaining.
      Parameters:
      standardDeviation - the standard deviation of the normal distribution
      Returns:
      this builder
    • min

      public NormalIntegerGenerator.Builder min(int min)
      Sets the inclusive lower bound that rounded values are clamped to. Returns this builder for chaining.
      Parameters:
      min - the minimum value
      Returns:
      this builder
    • max

      public NormalIntegerGenerator.Builder max(int max)
      Sets the inclusive upper bound that rounded values are clamped to. Returns this builder for chaining.
      Parameters:
      max - the maximum value
      Returns:
      this builder
    • build

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