Package org.instancio.generator.specs
Interface ShortSpec
- All Superinterfaces:
AsGeneratorSpec<Short>,GeneratorSpec<Short>,NullableGeneratorSpec<Short>,NumberGeneratorSpec<Short>,NumberSpec<Short>,Supplier<Short>,ValueSpec<Short>
Spec for generating
Short values.- Since:
- 2.6.0
-
Method Summary
Methods inherited from interface org.instancio.generator.specs.AsGeneratorSpec
as, asString
-
Method Details
-
min
Specifies the lower bound.- Specified by:
minin interfaceNumberGeneratorSpec<Short>- Specified by:
minin interfaceNumberSpec<Short>- Parameters:
min- lower bound (inclusive)- Returns:
- spec builder
- Since:
- 2.6.0
-
max
Specifies the upper bound.- Specified by:
maxin interfaceNumberGeneratorSpec<Short>- Specified by:
maxin interfaceNumberSpec<Short>- Parameters:
max- upper bound (inclusive)- Returns:
- spec builder
- Since:
- 2.6.0
-
range
Specifies the range for generated numbers.The following examples use
int, however the same principle applies to all numeric types, includingBigIntegerandBigDecimal.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<Short>- Specified by:
rangein interfaceNumberSpec<Short>- Parameters:
min- lower bound (inclusive)max- upper bound (inclusive)- Returns:
- spec builder
- Since:
- 2.6.0
-
nullable
ShortSpec nullable()Specifies that anullvalue can be generated- Specified by:
nullablein interfaceNullableGeneratorSpec<Short>- Specified by:
nullablein interfaceNumberGeneratorSpec<Short>- Specified by:
nullablein interfaceNumberSpec<Short>- Specified by:
nullablein interfaceValueSpec<Short>- Returns:
- spec builder reference
- Since:
- 2.6.0
-