Package org.keycloak.services.validation
Class Validation
- java.lang.Object
-
- org.keycloak.services.validation.Validation
-
public class Validation extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
FIELD_EMAIL
static String
FIELD_OTP_CODE
static String
FIELD_OTP_LABEL
static String
FIELD_PASSWORD
static String
FIELD_PASSWORD_CONFIRM
static String
FIELD_USERNAME
-
Constructor Summary
Constructors Constructor Description Validation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<FormMessage>
getFormErrorsFromValidation(List<ValidationException.Error> errors)
static boolean
isBlank(String s)
Check if string is blank (null or lenght is 0 or contains only white characters)static boolean
isEmailValid(String email)
static boolean
isEmpty(String s)
Check if string is empty (null or lenght is 0)static boolean
isUsernameValid(String username)
-
-
-
Field Detail
-
FIELD_PASSWORD_CONFIRM
public static final String FIELD_PASSWORD_CONFIRM
- See Also:
- Constant Field Values
-
FIELD_EMAIL
public static final String FIELD_EMAIL
- See Also:
- Constant Field Values
-
FIELD_PASSWORD
public static final String FIELD_PASSWORD
- See Also:
- Constant Field Values
-
FIELD_USERNAME
public static final String FIELD_USERNAME
- See Also:
- Constant Field Values
-
FIELD_OTP_CODE
public static final String FIELD_OTP_CODE
- See Also:
- Constant Field Values
-
FIELD_OTP_LABEL
public static final String FIELD_OTP_LABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEmpty
public static boolean isEmpty(String s)
Check if string is empty (null or lenght is 0)- Parameters:
s
- to check- Returns:
- true if string is empty
-
isBlank
public static boolean isBlank(String s)
Check if string is blank (null or lenght is 0 or contains only white characters)- Parameters:
s
- to check- Returns:
- true if string is blank
-
isEmailValid
public static boolean isEmailValid(String email)
-
isUsernameValid
public static boolean isUsernameValid(String username)
-
getFormErrorsFromValidation
public static List<FormMessage> getFormErrorsFromValidation(List<ValidationException.Error> errors)
-
-