Package dev.orne.test.rnd.generators
Class BigDecimalGenerator
java.lang.Object
dev.orne.test.rnd.AbstractGenerator
dev.orne.test.rnd.AbstractTypedGenerator<BigDecimal>
dev.orne.test.rnd.generators.BigDecimalGenerator
- All Implemented Interfaces:
Generator,TypedGenerator<BigDecimal>
@API(status=STABLE,
since="0.1")
@Priority(-1000)
public class BigDecimalGenerator
extends AbstractTypedGenerator<BigDecimal>
Generator of
BigDecimal and Number values.- Since:
- 0.1
- Version:
- 1.0, 2022-10
- Author:
- (w) Iker Hernaez
-
Field Summary
FieldsFields inherited from class dev.orne.test.rnd.AbstractGenerator
DEFAULT_NULL_PROBABILITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull BigDecimalReturns the default value of the supported type.static BigDecimalGenerates a randomBigDecimalwith unescaled value between -1032 and 1032 (both excluded) and scale between -1022 and 1023 (both included).@NotNull BigDecimalReturns a random value of the supported type.booleanChecks if values of the specified type can be generated by this instance.Methods inherited from class dev.orne.test.rnd.AbstractTypedGenerator
defaultValue, equals, getValueType, hashCode, nullableDefaultValue, nullableRandomValue, randomValueMethods inherited from class dev.orne.test.rnd.AbstractGenerator
assertSupported, getNullProbability, nullableDefaultValue, nullableRandomValue, randomNull, setNullProbability, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.orne.test.rnd.Generator
asParameterizable, getPriority, nullableDefaultValue, nullableRandomValue
-
Field Details
-
DEFAULT_VALUE
The default value.
-
-
Constructor Details
-
BigDecimalGenerator
public BigDecimalGenerator()Creates a new instance.
-
-
Method Details
-
supports
Checks if values of the specified type can be generated by this instance.- Specified by:
supportsin interfaceGenerator- Overrides:
supportsin classAbstractTypedGenerator<BigDecimal>- Parameters:
type- The type to check.- Returns:
- If values of the specified type can be generated.
-
defaultValue
Returns the default value of the supported type.- Returns:
- The default value.
-
randomValue
Returns a random value of the supported type.- Returns:
- A random value.
-
randomBigDecimal
Generates a randomBigDecimalwith unescaled value between -1032 and 1032 (both excluded) and scale between -1022 and 1023 (both included).- Returns:
- A random
BigDecimalvalue
-