Class RegexValidator
java.lang.Object
org.ntnu.idi.idatt2106.sparesti.sparestibackend.validation.RegexValidator
Validator class for regexes
- Since:
- 25.4.24
- Version:
- 1.0
- Author:
- Harry Linrui Xu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisEmailValid(String email) Checks if email is invalid.static booleanisNameValid(String name) Checks if name is validstatic booleanisPasswordStrong(String password) Checks if a password meets the strength criteria.static booleanisUsernameValid(String username) Checks if username is valid.
-
Constructor Details
-
RegexValidator
public RegexValidator()
-
-
Method Details
-
isUsernameValid
Checks if username is valid.- Parameters:
username- Username- Returns:
- True, if username is valid. Else, returns false.
-
isEmailValid
Checks if email is invalid.- Parameters:
email- Email- Returns:
- True, if email is valid.
-
isNameValid
Checks if name is valid- Parameters:
name- Name- Returns:
- If name is valid
-
isPasswordStrong
Checks if a password meets the strength criteria.- Parameters:
password- The password to check- Returns:
- true if the password meets the criteria, false otherwise
-