Package org.instancio.generator.time
Class PeriodGenerator
java.lang.Object
org.instancio.generator.time.PeriodGenerator
- All Implemented Interfaces:
Generator<Period>
,GeneratorSpec<Period>
,PeriodGeneratorSpec
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.instancio.Generator
apiMethodName, getHints, isDelegating, setDelegate, supports, targetClass
-
Constructor Details
-
PeriodGenerator
public PeriodGenerator()
-
-
Method Details
-
days
Description copied from interface:PeriodGeneratorSpec
Generate number ofPeriod
days in the given range.- Specified by:
days
in interfacePeriodGeneratorSpec
- Parameters:
min
- minimum number of days (inclusive)max
- maximum number of days (inclusive)- Returns:
- spec builder
-
months
Description copied from interface:PeriodGeneratorSpec
Generate number ofPeriod
months in the given range.- Specified by:
months
in interfacePeriodGeneratorSpec
- Parameters:
min
- minimum number of months (inclusive)max
- maximum number of months (inclusive)- Returns:
- spec builder
-
years
Description copied from interface:PeriodGeneratorSpec
Generate number ofPeriod
years in the given range.- Specified by:
years
in interfacePeriodGeneratorSpec
- Parameters:
min
- minimum number of years (inclusive)max
- maximum number of years (inclusive)- Returns:
- spec builder
-
generate
Description copied from interface:Generator
Returns a generated value.If the generated value is random, it needs to be generated using the given
Random
instance. This ensures the data is generated with the same seed value and allows random data to be reproduced by specifying the seed value.
-