Package org.instancio.generator.specs
Interface OneOfArraySpec<T>
- Type Parameters:
T
- type of value
- All Superinterfaces:
GeneratorSpec<T>
,NullableGeneratorSpec<T>
,OneOfArrayGeneratorSpec<T>
,ValueSpec<T>
Spec for selecting a random value from an array.
- Since:
- 2.6.0
-
Method Summary
Methods inherited from interface org.instancio.generator.specs.NullableGeneratorSpec
nullable
-
Method Details
-
oneOf
Description copied from interface:OneOfArrayGeneratorSpec
Selects a random value from the given choices.- Specified by:
oneOf
in interfaceOneOfArrayGeneratorSpec<T>
- Parameters:
values
- from which a random value will be selected- Returns:
- spec builder
-
toModel
Description copied from interface:ValueSpec
Returns the spec as aModel
.Example:
Model<String> stringModel = Gen.string().length(10).digits().toModel(); String result = Instancio.create(stringModel);
-