Package org.instancio.generator.specs
Interface DurationSpec
- All Superinterfaces:
DurationGeneratorSpec,GeneratorSpec<Duration>,NullableGeneratorSpec<Duration>,ValueSpec<Duration>
Spec for generating
Duration.- Since:
- 2.9.0
-
Method Summary
Modifier and TypeMethodDescriptionAllow aDurationof length zero to be generated.max(long amount, TemporalUnit unit) Generate aDurationless than or equal to the specified amount.min(long amount, TemporalUnit unit) Generate aDurationgreater than or equal to the specified amount.nullable()Specifies that anullvalue can be generatedof(long minAmount, long maxAmount, TemporalUnit unit) Generate aDurationin the given range, measured in specified units.
-
Method Details
-
min
Description copied from interface:DurationGeneratorSpecGenerate aDurationgreater than or equal to the specified amount.- Specified by:
minin interfaceDurationGeneratorSpec- Parameters:
amount- minimum duration amount (inclusive)unit- unit the amount is measured in- Returns:
- spec builder
-
max
Description copied from interface:DurationGeneratorSpecGenerate aDurationless than or equal to the specified amount.- Specified by:
maxin interfaceDurationGeneratorSpec- Parameters:
amount- maximum duration amount (inclusive)unit- unit the amount is measured in- Returns:
- spec builder
-
of
Description copied from interface:DurationGeneratorSpecGenerate aDurationin the given range, measured in specified units.- Specified by:
ofin interfaceDurationGeneratorSpec- Parameters:
minAmount- minimum duration amount (inclusive)maxAmount- maximum duration amount (inclusive)unit- unit the amount is measured in- Returns:
- spec builder
-
allowZero
DurationSpec allowZero()Description copied from interface:DurationGeneratorSpecAllow aDurationof length zero to be generated.- Specified by:
allowZeroin interfaceDurationGeneratorSpec- Returns:
- spec builder
-
nullable
DurationSpec nullable()Description copied from interface:ValueSpecSpecifies that anullvalue can be generated- Specified by:
nullablein interfaceDurationGeneratorSpec- Specified by:
nullablein interfaceNullableGeneratorSpec<Duration>- Specified by:
nullablein interfaceValueSpec<Duration>- Returns:
- spec builder reference
-