Package org.instancio.settings
Enum StringType
- All Implemented Interfaces:
Serializable,Comparable<StringType>,java.lang.constant.Constable
A setting that specifies the type of
String to generate.
String type can be set using the Keys.STRING_TYPE setting:
Person person = Instancio.of(Person.class)
.withSetting(Keys.STRING_TYPE, StringType.ALPHANUMERIC) // all strings alphanumeric
.create();
- Since:
- 4.7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents an alphabetic string, uppercase by default, that consists of characters[A-Z].Represents an alphanumeric string, uppercase by default, that consists of characters[0-9A-Z].Represents a string that consists of digits[0-9].Represents a hexadecimal string, uppercase by default, that consists of characters[0-9A-F]Represents a string sequence that starts from"1"and increments by one.Represents a Unicode string that consists of random code points, excluding the following character types:Character.PRIVATE_USECharacter.SURROGATECharacter.UNASSIGNED -
Method Summary
Modifier and TypeMethodDescriptionstatic StringTypeReturns the enum constant of this type with the specified name.static StringType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ALPHABETIC
Represents an alphabetic string, uppercase by default, that consists of characters[A-Z].- Since:
- 4.7.0
-
ALPHANUMERIC
Represents an alphanumeric string, uppercase by default, that consists of characters[0-9A-Z].The equivalent string generator spec method is
StringGeneratorSpec.alphaNumeric().- Since:
- 4.7.0
-
DIGITS
Represents a string that consists of digits[0-9].The equivalent string generator spec method is
StringGeneratorSpec.digits().- Since:
- 4.7.0
-
HEX
Represents a hexadecimal string, uppercase by default, that consists of characters[0-9A-F]The equivalent string generator spec method is
StringGeneratorSpec.hex().- Since:
- 4.7.0
-
NUMERIC_SEQUENCE
Represents a string sequence that starts from"1"and increments by one.The equivalent string generator spec method is
StringGeneratorSpec.numericSequence().- Since:
- 4.7.0
-
UNICODE
Represents a Unicode string that consists of random code points, excluding the following character types:The equivalent string generator spec method is
StringGeneratorSpec.unicode(Character.UnicodeBlock...).- Since:
- 4.7.0
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-