Class ScaledBigDecimalGenerator.Builder
- All Implemented Interfaces:
Builder<BigDecimal>
- Enclosing class:
ScaledBigDecimalGenerator
Fluent builder for
ScaledBigDecimalGenerator.-
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.end(double end) Sets the exclusive upper bound of the generated range.scale(int scale) Sets the number of decimal places (fractional digits) the value is rounded to, usingRoundingMode.HALF_UP.start(double start) Sets the inclusive lower bound of the generated range.
-
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
-
start
Sets the inclusive lower bound of the generated range. Defaults to0.- Parameters:
start- the smallest value that may be generated (inclusive)- Returns:
- this builder, for chaining
-
end
Sets the exclusive upper bound of the generated range. Defaults to1; generated values are always strictly less than this bound.- Parameters:
end- the upper bound that may never be generated (exclusive)- Returns:
- this builder, for chaining
-
scale
Sets the number of decimal places (fractional digits) the value is rounded to, usingRoundingMode.HALF_UP. Defaults to2.- Parameters:
scale- the number of digits to the right of the decimal point- 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
-