java.lang.Object
java.lang.Enum<RegexPattern>
org.ntnu.idi.idatt2106.sparesti.sparestibackend.validation.RegexPattern
All Implemented Interfaces:
Serializable, Comparable<RegexPattern>, Constable

public enum RegexPattern extends Enum<RegexPattern>
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 Constants
    Enum Constant
    Description
    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
    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
    Valid password contains at least 8 characters and at max 30 characters, including numbers, Norwegian letters and at least 1 special character
    Valid username starts with a letter.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static RegexPattern[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • USERNAME

      public static final RegexPattern USERNAME
      Valid username starts with a letter. Valid characters are Norwegian letters, numbers and underscore. Length must be between 3 and 30 characters.
    • PASSWORD

      public static final RegexPattern PASSWORD
      Valid password contains at least 8 characters and at max 30 characters, including numbers, Norwegian letters and at least 1 special character
    • EMAIL

      public static final RegexPattern 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

      public static final RegexPattern 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

      public static RegexPattern[] 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

      public static RegexPattern valueOf(String name)
      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 name
      NullPointerException - if the argument is null