Package org.instancio.generator.util
Class CalendarGenerator
- java.lang.Object
-
- org.instancio.generator.AbstractGenerator<Calendar>
-
- org.instancio.generator.util.CalendarGenerator
-
- All Implemented Interfaces:
Generator<Calendar>
,GeneratorSpec<Calendar>
,TemporalGeneratorSpec<Calendar>
public class CalendarGenerator extends AbstractGenerator<Calendar> implements TemporalGeneratorSpec<Calendar>
-
-
Field Summary
-
Fields inherited from interface org.instancio.generator.specs.TemporalGeneratorSpec
DEFAULT_MAX, DEFAULT_MIN, ZONE_OFFSET
-
-
Constructor Summary
Constructors Constructor Description CalendarGenerator(GeneratorContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemporalGeneratorSpec<Calendar>
future()
Generate a temporal value in the future.Calendar
generate(Random random)
Returns a generated value.TemporalGeneratorSpec<Calendar>
past()
Generate a temporal value in the past.TemporalGeneratorSpec<Calendar>
range(Calendar start, Calendar end)
Generate a temporal value between the given range.-
Methods inherited from class org.instancio.generator.AbstractGenerator
getContext
-
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 Detail
-
CalendarGenerator
public CalendarGenerator(GeneratorContext context)
-
-
Method Detail
-
past
public TemporalGeneratorSpec<Calendar> past()
Description copied from interface:TemporalGeneratorSpec
Generate a temporal value in the past.- Specified by:
past
in interfaceTemporalGeneratorSpec<Calendar>
- Returns:
- spec builder
-
future
public TemporalGeneratorSpec<Calendar> future()
Description copied from interface:TemporalGeneratorSpec
Generate a temporal value in the future.- Specified by:
future
in interfaceTemporalGeneratorSpec<Calendar>
- Returns:
- spec builder
-
range
public TemporalGeneratorSpec<Calendar> range(Calendar start, Calendar end)
Description copied from interface:TemporalGeneratorSpec
Generate a temporal value between the given range.- Specified by:
range
in interfaceTemporalGeneratorSpec<Calendar>
- Parameters:
start
- start date (inclusive)end
- end date (inclusive)- Returns:
- spec builder
-
generate
public Calendar generate(Random random)
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.
-
-