Package org.instancio.generator.math
Class BigDecimalGenerator
java.lang.Object
org.instancio.generator.AbstractGenerator<T>
org.instancio.generator.lang.AbstractRandomNumberGeneratorSpec<T>
org.instancio.generator.lang.AbstractRandomComparableNumberGeneratorSpec<BigDecimal>
org.instancio.generator.math.BigDecimalGenerator
- All Implemented Interfaces:
Generator<BigDecimal>
,GeneratorSpec<BigDecimal>
,NumberGeneratorSpec<BigDecimal>
public class BigDecimalGenerator
extends AbstractRandomComparableNumberGeneratorSpec<BigDecimal>
implements NumberGeneratorSpec<BigDecimal>
-
Field Summary
Fields inherited from class org.instancio.generator.lang.AbstractRandomNumberGeneratorSpec
max, min, nullable
-
Constructor Summary
ConstructorDescriptionBigDecimalGenerator
(GeneratorContext context) BigDecimalGenerator
(GeneratorContext context, BigDecimal min, BigDecimal max, boolean nullable) -
Method Summary
Modifier and TypeMethodDescriptionprotected BigDecimal
generateNonNullValue
(RandomProvider random) max
(BigDecimal max) Upper bound for the random number generator.min
(BigDecimal min) Lower bound for the random number generator.Methods inherited from class org.instancio.generator.lang.AbstractRandomComparableNumberGeneratorSpec
range
Methods inherited from class org.instancio.generator.lang.AbstractRandomNumberGeneratorSpec
generate, getHints, getMax, getMin, nullable
Methods inherited from class org.instancio.generator.AbstractGenerator
getContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.instancio.Generator
apiMethodName, isDelegating, setDelegate, supports, targetClass
Methods inherited from interface org.instancio.generator.lang.NumberGeneratorSpec
nullable, range
-
Constructor Details
-
BigDecimalGenerator
-
BigDecimalGenerator
public BigDecimalGenerator(GeneratorContext context, BigDecimal min, BigDecimal max, boolean nullable)
-
-
Method Details
-
min
Description copied from class:AbstractRandomComparableNumberGeneratorSpec
Lower bound for the random number generator.If the specified
min
value is greater than or equal to the currentmax
value, themax
value will be updated to a value higher than the givenmin
.- Specified by:
min
in interfaceNumberGeneratorSpec<BigDecimal>
- Overrides:
min
in classAbstractRandomComparableNumberGeneratorSpec<BigDecimal>
- Parameters:
min
- lower bound (inclusive)- Returns:
- spec builder
-
max
Description copied from class:AbstractRandomComparableNumberGeneratorSpec
Upper bound for the random number generator.If the specified
max
value is less than or equal to the currentmin
value, themin
value will be updated to a value lower than the givenmax
.- Specified by:
max
in interfaceNumberGeneratorSpec<BigDecimal>
- Overrides:
max
in classAbstractRandomComparableNumberGeneratorSpec<BigDecimal>
- Parameters:
max
- upper bound (exclusive)- Returns:
- spec builder
-
generateNonNullValue
- Specified by:
generateNonNullValue
in classAbstractRandomNumberGeneratorSpec<BigDecimal>
-