Package org.instancio.generator.specs
Interface FloatSpec
- All Superinterfaces:
GeneratorSpec<Float>,NullableGeneratorSpec<Float>,NumberGeneratorSpec<Float>,NumberSpec<Float>,ValueSpec<Float>
- All Known Implementing Classes:
FloatGenerator
Spec for generating
Float values.- Since:
- 2.6.0
-
Method Summary
-
Method Details
-
min
Description copied from interface:NumberGeneratorSpecSpecifies the lower bound.- Specified by:
minin interfaceNumberGeneratorSpec<Float>- Specified by:
minin interfaceNumberSpec<Float>- Parameters:
min- lower bound (inclusive)- Returns:
- spec builder
-
max
Description copied from interface:NumberGeneratorSpecSpecifies the upper bound.- Specified by:
maxin interfaceNumberGeneratorSpec<Float>- Specified by:
maxin interfaceNumberSpec<Float>- Parameters:
max- upper bound (inclusive)- Returns:
- spec builder
-
range
Description copied from interface:NumberGeneratorSpecSpecifies the range for the generated number.This method can be invoked multiple times to specify several ranges, for example, the following will generate a random value within
[10-15]or[20-25]:
Note: this method has higher precedence thanints().range(10, 15).range(20, 25)NumberGeneratorSpec.min(Number)andNumberGeneratorSpec.max(Number). For example, the following will generate a number within[1, 5]:ints().range(1, 5).min(95).max(99)- Specified by:
rangein interfaceNumberGeneratorSpec<Float>- Specified by:
rangein interfaceNumberSpec<Float>- Parameters:
min- lower bound (inclusive)max- upper bound (inclusive)- Returns:
- spec builder
-
nullable
FloatSpec nullable()Description copied from interface:ValueSpecSpecifies that anullvalue can be generated- Specified by:
nullablein interfaceNullableGeneratorSpec<Float>- Specified by:
nullablein interfaceNumberGeneratorSpec<Float>- Specified by:
nullablein interfaceNumberSpec<Float>- Specified by:
nullablein interfaceValueSpec<Float>- Returns:
- spec builder reference
-