Class DurationRandomizer
java.lang.Object
org.jeasy.random.randomizers.time.DurationRandomizer
- All Implemented Interfaces:
Randomizer<java.time.Duration>
A
Randomizer that generates random Duration.- Author:
- Mahmoud Ben Hassine ([email protected])
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newDurationRandomizer.DurationRandomizer(long seed) Create a newDurationRandomizer.DurationRandomizer(long seed, java.time.temporal.TemporalUnit unit) Create a newDurationRandomizer.DurationRandomizer(java.time.temporal.TemporalUnit unit) Create a newDurationRandomizer. -
Method Summary
Modifier and TypeMethodDescriptionjava.time.DurationGenerate a random value for the given type.
-
Constructor Details
-
DurationRandomizer
public DurationRandomizer() -
DurationRandomizer
public DurationRandomizer(java.time.temporal.TemporalUnit unit) Create a newDurationRandomizer.- Parameters:
unit- the temporal unit for created durations
-
DurationRandomizer
public DurationRandomizer(long seed) - Parameters:
seed- initial seed
-
DurationRandomizer
public DurationRandomizer(long seed, java.time.temporal.TemporalUnit unit) Create a newDurationRandomizer.- Parameters:
seed- initial seedunit- the temporal unit for created durations
-
-
Method Details
-
getRandomValue
public java.time.Duration getRandomValue()Description copied from interface:RandomizerGenerate a random value for the given type.- Specified by:
getRandomValuein interfaceRandomizer<java.time.Duration>- Returns:
- a random value for the given type
-