Package dev.orne.test.rnd.generators
Class DoubleGenerator
java.lang.Object
dev.orne.test.rnd.AbstractGenerator
dev.orne.test.rnd.AbstractTypedGenerator<T>
dev.orne.test.rnd.generators.AbstractPrimitiveGenerator<Double>
dev.orne.test.rnd.generators.DoubleGenerator
- All Implemented Interfaces:
Generator,TypedGenerator<Double>
@API(status=STABLE,
since="0.1")
@Priority(-1000)
public class DoubleGenerator
extends AbstractPrimitiveGenerator<Double>
Generator of
double and Double 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 DoubleReturns the default value of the supported type.static doubleGenerates a randomdoublebetweenDouble.NEGATIVE_INFINITYandDouble.POSITIVE_INFINITYboth included.static doubleGenerates a randomdoublebetweenDouble.NEGATIVE_INFINITYandDouble.POSITIVE_INFINITYboth excluded.@NotNull DoubleReturns a random value of the supported type.Methods inherited from class dev.orne.test.rnd.generators.AbstractPrimitiveGenerator
nullableDefaultValue, randomNull, supportsMethods 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, nullableRandomValue, 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, nullableRandomValue
-
Field Details
-
DEFAULT_VALUE
public static final double DEFAULT_VALUEThe default value.- See Also:
-
-
Constructor Details
-
DoubleGenerator
public DoubleGenerator()Creates a new instance.
-
-
Method Details
-
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.
-
randomDouble
public static double randomDouble()Generates a randomdoublebetweenDouble.NEGATIVE_INFINITYandDouble.POSITIVE_INFINITYboth included.- Returns:
- A random
doublevalue
-
randomFiniteDouble
public static double randomFiniteDouble()Generates a randomdoublebetweenDouble.NEGATIVE_INFINITYandDouble.POSITIVE_INFINITYboth excluded.- Returns:
- A random
doublevalue
-