Package org.instancio.generator.specs
Interface NumberAsGeneratorSpec<T extends Number>
- All Superinterfaces:
AsGeneratorSpec<T>
,AsStringGeneratorSpec<T>
,GeneratorSpec<T>
,NullableGeneratorSpec<T>
,NumberGeneratorSpec<T>
- All Known Implementing Classes:
AbstractRandomComparableNumberGeneratorSpec
,AbstractRandomNumberGeneratorSpec
,AtomicIntegerGenerator
,AtomicLongGenerator
,BigDecimalGenerator
,BigIntegerGenerator
,ByteGenerator
,DoubleGenerator
,FloatGenerator
,IntegerGenerator
,LongGenerator
,ShortGenerator
public interface NumberAsGeneratorSpec<T extends Number>
extends NumberGeneratorSpec<T>, AsGeneratorSpec<T>, AsStringGeneratorSpec<T>
Generator spec for
Number
types
that supports AsGeneratorSpec
.- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionUpper bound for the random number generator.Lower bound for the random number generator.nullable()
Specifies the generated value can benull
.Range for the random number generatorMethods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
Methods inherited from interface org.instancio.generator.AsStringGeneratorSpec
asString
-
Method Details
-
min
Description copied from interface:NumberGeneratorSpec
Lower bound for the random number generator.- Specified by:
min
in interfaceNumberGeneratorSpec<T extends Number>
- Parameters:
min
- lower bound (inclusive)- Returns:
- spec builder
-
max
Description copied from interface:NumberGeneratorSpec
Upper bound for the random number generator.- Specified by:
max
in interfaceNumberGeneratorSpec<T extends Number>
- Parameters:
max
- upper bound (inclusive)- Returns:
- spec builder
-
range
Description copied from interface:NumberGeneratorSpec
Range for the random number generator- Specified by:
range
in interfaceNumberGeneratorSpec<T extends Number>
- Parameters:
min
- lower bound (inclusive)max
- upper bound (inclusive)- Returns:
- spec builder
-
nullable
NumberAsGeneratorSpec<T> nullable()Description copied from interface:NumberGeneratorSpec
Specifies the generated value can benull
.- Specified by:
nullable
in interfaceNullableGeneratorSpec<T extends Number>
- Specified by:
nullable
in interfaceNumberGeneratorSpec<T extends Number>
- Returns:
- spec builder
-