Package org.instancio.generator.specs
Interface EnumSpec<E extends Enum<E>>
- Type Parameters:
E- enum type
- All Superinterfaces:
EnumGeneratorSpec<E>,GeneratorSpec<E>,NullableGeneratorSpec<E>,ValueSpec<E>
Spec for generating enums.
- Since:
- 2.12.0
-
Method Summary
-
Method Details
-
excluding
Generate an enum while excluding the specified values. The argument can be an empty array, but notnull.- Specified by:
excludingin interfaceEnumGeneratorSpec<E extends Enum<E>>- Parameters:
values- to exclude- Returns:
- spec builder
- Since:
- 2.12.0
-
nullable
Specifies that anullvalue can be generated -
toModel
toModel()is not supported by this spec.Returns the spec as a
Model.Example:
Model<String> stringModel = Gen.string().length(10).digits().toModel(); String result = Instancio.create(stringModel);
-