Class UUIDStringGenerator
java.lang.Object
org.instancio.internal.generator.AbstractGenerator<String>
org.instancio.internal.generator.text.UUIDStringGenerator
- All Implemented Interfaces:
Generator<String>
,GeneratorSpec<String>
,NullableGeneratorSpec<String>
,UUIDStringGeneratorSpec
,UUIDStringSpec
,ValueSpec<String>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the public API method name of the generator spec.nullable()
Indicates thatnull
value can be generated.protected String
tryGenerateNonNull
(Random random) Makes the best effort to return a non-null value.Generate UUID String in uppercase characters.Generate UUID String without dashes.Methods inherited from class org.instancio.internal.generator.AbstractGenerator
generate, getContext, hints, isNullable, nullable
-
Constructor Details
-
UUIDStringGenerator
public UUIDStringGenerator() -
UUIDStringGenerator
-
-
Method Details
-
apiMethod
Description copied from class:AbstractGenerator
Returns the public API method name of the generator spec. The returned name is used for reporting validation errors.- Specified by:
apiMethod
in classAbstractGenerator<String>
- Returns:
- spec name if defined, or
null
otherwise
-
upperCase
Description copied from interface:UUIDStringGeneratorSpec
Generate UUID String in uppercase characters.- Specified by:
upperCase
in interfaceUUIDStringGeneratorSpec
- Specified by:
upperCase
in interfaceUUIDStringSpec
- Returns:
- spec builder
-
withoutDashes
Description copied from interface:UUIDStringGeneratorSpec
Generate UUID String without dashes.- Specified by:
withoutDashes
in interfaceUUIDStringGeneratorSpec
- Specified by:
withoutDashes
in interfaceUUIDStringSpec
- Returns:
- spec builder
-
nullable
Description copied from interface:NullableGeneratorSpec
Indicates thatnull
value can be generated.- Specified by:
nullable
in interfaceNullableGeneratorSpec<String>
- Specified by:
nullable
in interfaceUUIDStringSpec
- Specified by:
nullable
in interfaceValueSpec<String>
- Overrides:
nullable
in classAbstractGenerator<String>
- Returns:
- spec builder
-
tryGenerateNonNull
Description copied from class:AbstractGenerator
Makes the best effort to return a non-null value. However, in certain cases this method will produce anull
.- Specified by:
tryGenerateNonNull
in classAbstractGenerator<String>
- Parameters:
random
- for generating the value- Returns:
- generated value, either a null or non-null
-