Package org.instancio.generator.specs
Interface DurationGeneratorSpec
- All Superinterfaces:
GeneratorSpec<Duration>
- All Known Subinterfaces:
DurationSpec
- All Known Implementing Classes:
DurationGenerator
Generator spec for
Duration.- Since:
- 1.5.4
-
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.of(long minAmount, long maxAmount, TemporalUnit unit) Generate aDurationin the given range, measured in specified units.
-
Method Details
-
min
Generate aDurationgreater than or equal to the specified amount.- Parameters:
amount- minimum duration amount (inclusive)unit- unit the amount is measured in- Returns:
- spec builder
- Since:
- 2.10.0
-
max
Generate aDurationless than or equal to the specified amount.- Parameters:
amount- maximum duration amount (inclusive)unit- unit the amount is measured in- Returns:
- spec builder
- Since:
- 2.10.0
-
of
Generate aDurationin the given range, measured in specified units.- Parameters:
minAmount- minimum duration amount (inclusive)maxAmount- maximum duration amount (inclusive)unit- unit the amount is measured in- Returns:
- spec builder
- Since:
- 1.5.4
-
allowZero
DurationGeneratorSpec allowZero()Allow aDurationof length zero to be generated.- Returns:
- spec builder
- Since:
- 1.5.4
-