Package org.instancio.generator.specs
Interface DurationSpec
- All Superinterfaces:
DurationGeneratorSpec
,GeneratorSpec<Duration>
,ValueSpec<Duration>
- All Known Implementing Classes:
DurationGenerator
Spec for generating
Duration
.- Since:
- 2.9.0
-
Method Summary
Modifier and TypeMethodDescriptionAllow aDuration
of length zero to be generated.of
(long minAmount, long maxAmount, TemporalUnit unit) Generate aDuration
in the given range, measured in specified units.
-
Method Details
-
of
Description copied from interface:DurationGeneratorSpec
Generate aDuration
in the given range, measured in specified units.- Specified by:
of
in interfaceDurationGeneratorSpec
- Parameters:
minAmount
- minimum duration amount (inclusive)maxAmount
- maximum duration amount (inclusive)unit
- unit the duration is measured in- Returns:
- spec builder
-
allowZero
DurationSpec allowZero()Description copied from interface:DurationGeneratorSpec
Allow aDuration
of length zero to be generated.- Specified by:
allowZero
in interfaceDurationGeneratorSpec
- Returns:
- spec builder
-