Package org.instancio.generators
Class XMLGregorianCalendarGenerator
- java.lang.Object
-
- org.instancio.generators.AbstractRandomGenerator<XMLGregorianCalendar>
-
- org.instancio.generators.XMLGregorianCalendarGenerator
-
- All Implemented Interfaces:
Generator<XMLGregorianCalendar>
,GeneratorSpec<XMLGregorianCalendar>
public class XMLGregorianCalendarGenerator extends AbstractRandomGenerator<XMLGregorianCalendar>
-
-
Constructor Summary
Constructors Constructor Description XMLGregorianCalendarGenerator(GeneratorContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLGregorianCalendar
generate()
Depending on implementation, repeated invocations may return different values.-
Methods inherited from class org.instancio.generators.AbstractRandomGenerator
getContext, random
-
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
getHints, isDelegating, setDelegate, targetType
-
-
-
-
Constructor Detail
-
XMLGregorianCalendarGenerator
public XMLGregorianCalendarGenerator(GeneratorContext context)
-
-
Method Detail
-
generate
public XMLGregorianCalendar generate()
Description copied from interface:Generator
Depending on implementation, repeated invocations may return different values. Some implementations may return random values on each invocation, while others may return predefined values or random values from a given set.Generators can be passed in as a lambda function. The following example shows how to override generation strategy for certain fields.
Person person = Instancio.of(Person.class) .generate(field("age"), gen -> gen.oneOf(20, 30, 40, 50)) .supply(field("location"), () -> "Canada") .supply(all(LocalDateTime.class), () -> LocalDateTime.now()) .create();
- Returns:
- generated value
-
-