Class BigDecimalGenerator.Builder

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

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

    • precision

      public BigDecimalGenerator.Builder precision(Integer maxPrecision)
      Sets the maximum total precision: the number of significant digits on both sides of the decimal point. May be null (the default), in which case the value falls back to a DoubleGenerator result. When set, the effective precision is capped at 25.
      Parameters:
      maxPrecision - the maximum total number of significant digits, or null for none
      Returns:
      this builder, for chaining
    • digits

      public BigDecimalGenerator.Builder digits(Integer maxDigits)
      Sets the maximum scale: the number of fractional digits to the right of the decimal point. May be null (the default), which is treated as a scale of 0. The effective scale is capped at the effective precision, and must not exceed the configured precision or build() will produce a generator that throws at generation time.
      Parameters:
      maxDigits - the maximum number of fractional digits, or null for none
      Returns:
      this builder, for chaining
    • build

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