Enum Class RegexPattern
java.lang.Object
java.lang.Enum<RegexPattern>
org.ntnu.idi.idatt2106.sparesti.sparestibackend.validation.RegexPattern
- All Implemented Interfaces:
Serializable
,Comparable<RegexPattern>
,Constable
Class to represent the different regexes that are used to validate input fields.
- Since:
- 25.4.24
- Version:
- 1.0
- Author:
- Harry L.X
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionValid email must start with Norwegian letters, numbers, underscore, '+', ampersand, '*', '-' Valid email can include must include '@' Must include a period after '@' Must have letters after period of length 2-7 charactersA valid contains can only contain Norwegian letters, white space, comma, period, singe quotes and hyphens The name must have at least 1 character and at max 30 charactersValid password contains at least 8 characters and at max 30 characters, including numbers, Norwegian letters and at least 1 special characterValid username starts with a letter. -
Method Summary
Modifier and TypeMethodDescriptionstatic RegexPattern
Returns the enum constant of this class with the specified name.static RegexPattern[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USERNAME
Valid username starts with a letter. Valid characters are Norwegian letters, numbers and underscore. Length must be between 3 and 30 characters. -
PASSWORD
Valid password contains at least 8 characters and at max 30 characters, including numbers, Norwegian letters and at least 1 special character -
EMAIL
Valid email must start with Norwegian letters, numbers, underscore, '+', ampersand, '*', '-' Valid email can include must include '@' Must include a period after '@' Must have letters after period of length 2-7 characters -
NAME
A valid contains can only contain Norwegian letters, white space, comma, period, singe quotes and hyphens The name must have at least 1 character and at max 30 characters
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-