Class TreeSetGenerator<T>
- java.lang.Object
-
- org.instancio.generators.AbstractRandomGenerator<Collection<T>>
-
- org.instancio.generators.collections.CollectionGenerator<T>
-
- org.instancio.generators.collections.TreeSetGenerator<T>
-
- All Implemented Interfaces:
Generator<Collection<T>>
,CollectionGeneratorSpec<T>
,GeneratorSpec<Collection<T>>
public class TreeSetGenerator<T> extends CollectionGenerator<T>
-
-
Field Summary
-
Fields inherited from class org.instancio.generators.collections.CollectionGenerator
maxSize, minSize, nullable, nullableElements, type
-
-
Constructor Summary
Constructors Constructor Description TreeSetGenerator(GeneratorContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<T>
generate()
Depending on implementation, repeated invocations may return different values.-
Methods inherited from class org.instancio.generators.collections.CollectionGenerator
getHints, maxSize, minSize, nullable, nullableElements, type
-
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
isDelegating, setDelegate, targetType
-
-
-
-
Constructor Detail
-
TreeSetGenerator
public TreeSetGenerator(GeneratorContext context)
-
-
Method Detail
-
generate
public Collection<T> 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();
-
-