Package org.instancio.generator.specs
Interface StringGeneratorSpec
- All Superinterfaces:
GeneratorSpec<String>
,NullableGeneratorSpec<String>
- All Known Subinterfaces:
StringSpec
- All Known Implementing Classes:
StringGenerator
Generator spec for Strings.
- Since:
- 1.0.1
-
Method Summary
Modifier and TypeMethodDescriptionIndicates that an empty string can be generated.allowEmpty
(boolean isAllowed) Indicates if empty string can be generated.Generates a mixed case alphanumeric string.digits()
Generates a string comprised of only digits.length
(int length) Length of string to generate.length
(int minLength, int maxLength) Length of string to generate.Generates a lower case string.maxLength
(int length) Maximum length of string to generate.minLength
(int length) Minimum length of string to generate.Generates a mixed case string.nullable()
Indicates thatnull
value can be generated.Specifies a String prefix.Specifes a String suffix.Generates an upper case string.
-
Method Details
-
prefix
Specifies a String prefix.- Parameters:
prefix
- for generated strings- Returns:
- spec builder
-
suffix
Specifes a String suffix.- Parameters:
suffix
- for generated strings- Returns:
- spec builder
- Since:
- 2.7.0
-
allowEmpty
StringGeneratorSpec allowEmpty()Indicates that an empty string can be generated.- Returns:
- spec builder
-
allowEmpty
Indicates if empty string can be generated.- Parameters:
isAllowed
- iftrue
, empty strings can be generated- Returns:
- spec builder
- Since:
- 2.7.0
-
length
Length of string to generate.- Parameters:
length
- exact length to generate- Returns:
- spec builder
-
length
Length of string to generate.- Parameters:
minLength
- minimum length (inclusive)maxLength
- maximum length (inclusive)- Returns:
- spec builder
-
minLength
Minimum length of string to generate.- Parameters:
length
- minimum length (inclusive)- Returns:
- spec builder
-
maxLength
Maximum length of string to generate.- Parameters:
length
- maximum length (inclusive)- Returns:
- spec builder
-
lowerCase
StringGeneratorSpec lowerCase()Generates a lower case string.- Returns:
- spec builder
-
upperCase
StringGeneratorSpec upperCase()Generates an upper case string.- Returns:
- spec builder
-
mixedCase
StringGeneratorSpec mixedCase()Generates a mixed case string.- Returns:
- spec builder
-
alphaNumeric
StringGeneratorSpec alphaNumeric()Generates a mixed case alphanumeric string.- Returns:
- spec builder
-
digits
StringGeneratorSpec digits()Generates a string comprised of only digits.- Returns:
- spec builder
-
nullable
StringGeneratorSpec nullable()Description copied from interface:NullableGeneratorSpec
Indicates thatnull
value can be generated.- Specified by:
nullable
in interfaceNullableGeneratorSpec<String>
- Returns:
- spec builder
-