Package org.instancio.generator.array
Class OneOfArrayGenerator<T>
java.lang.Object
org.instancio.generator.AbstractGenerator<T>
org.instancio.generator.array.OneOfArrayGenerator<T>
- All Implemented Interfaces:
Generator<T>
,GeneratorSpec<T>
,OneOfArrayGeneratorSpec<T>
public class OneOfArrayGenerator<T>
extends AbstractGenerator<T>
implements OneOfArrayGeneratorSpec<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a generated value.final OneOfArrayGeneratorSpec<T>
Target class to generate.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
-
Constructor Details
-
OneOfArrayGenerator
-
-
Method Details
-
oneOf
- Specified by:
oneOf
in interfaceOneOfArrayGeneratorSpec<T>
-
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. -
targetClass
Description copied from interface:Generator
Target class to generate.If
Optional.empty()
is returned, it will default to the field type for fields, and element type for collection and array elements.If the type is an interface, such as
Set
, will generate a default implementation class such asHashSet
.- Specified by:
targetClass
in interfaceGenerator<T>
- Returns:
- target class
-