Class BigDecimalGenerator.Builder
- All Implemented Interfaces:
Builder<BigDecimal>
- Enclosing class:
BigDecimalGenerator
Fluent builder for
BigDecimalGenerator.-
Field Summary
Fields inherited from class AbstractBuilder
DEFAULT_REFERENCE, random -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(RandomGenerator random) Creates a builder backed by the given seeded random source. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a configured data generator.Sets the maximum scale: the number of fractional digits to the right of the decimal point.Sets the maximum total precision: the number of significant digits on both sides of the decimal point.
-
Constructor Details
-
Builder
Creates a builder backed by the given seeded random source.- Parameters:
random- the random source used to draw generated values
-
-
Method Details
-
precision
Sets the maximum total precision: the number of significant digits on both sides of the decimal point. May benull(the default), in which case the value falls back to aDoubleGeneratorresult. When set, the effective precision is capped at25.- Parameters:
maxPrecision- the maximum total number of significant digits, ornullfor none- Returns:
- this builder, for chaining
-
digits
Sets the maximum scale: the number of fractional digits to the right of the decimal point. May benull(the default), which is treated as a scale of0. The effective scale is capped at the effective precision, and must not exceed the configured precision orbuild()will produce a generator that throws at generation time.- Parameters:
maxDigits- the maximum number of fractional digits, ornullfor none- Returns:
- this builder, for chaining
-
build
Description copied from interface:BuilderBuilds and returns a configured data generator.- Returns:
- a new
DataGeneratorconfigured with the builder's settings
-