Package org.instancio.generator.util
Class OneOfCollectionGenerator<T>
- java.lang.Object
-
- org.instancio.generator.AbstractGenerator<T>
-
- org.instancio.generator.util.OneOfCollectionGenerator<T>
-
- All Implemented Interfaces:
Generator<T>
,GeneratorSpec<T>
,OneOfCollectionGeneratorSpec<T>
public class OneOfCollectionGenerator<T> extends AbstractGenerator<T> implements OneOfCollectionGeneratorSpec<T>
-
-
Constructor Summary
Constructors Constructor Description OneOfCollectionGenerator(GeneratorContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
generate(Random random)
Returns a generated value.OneOfCollectionGeneratorSpec<T>
oneOf(Collection<T> values)
-
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
-
OneOfCollectionGenerator
public OneOfCollectionGenerator(GeneratorContext context)
-
-
Method Detail
-
oneOf
public OneOfCollectionGeneratorSpec<T> oneOf(Collection<T> values)
- Specified by:
oneOf
in interfaceOneOfCollectionGeneratorSpec<T>
-
generate
public T 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.
-
-