public class UserValidationUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
UserValidationUtils.NameField |
Constructor and Description |
---|
UserValidationUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
changedSSN(java.lang.String ssn_,
java.lang.String un_)
Returns true if the given ssn is different from the ssn currently
associated with the given username.
|
static int |
getNameMaxSize(UserValidationUtils.NameField field_)
Returns the max character size for the given name field
|
static boolean |
isEmptyField(java.lang.String str_)
This returns true if a user field is empty.
|
static boolean |
isUniqueSSN(java.lang.String ssn_)
Returns true is there is no existing user with this ssn.
|
static boolean |
isUniqueUsername(java.lang.String username_)
Returns true if the username is valid and there is no existing user that has
the same username (case-insensitive).
|
static boolean |
isValidEmail(java.lang.String email_)
Returns true if the given email is valid.
|
static boolean |
isValidName(java.lang.String name_)
Valid names can contains letters, numbers, underscores, hyphens,
and whitespace.
|
static boolean |
isValidNameLength(java.lang.String name_,
UserValidationUtils.NameField field_)
Returns true if name is a valid length
|
static boolean |
isValidSSN(java.lang.String ssn_)
Valid ssns consist of 9 digits.
|
static boolean |
isValidTitle(java.lang.String title)
Valid titles can contain letters, underscores, hyphens, whitespace, and if specified numbers.
|
static boolean |
isValidUsername(java.lang.String username_)
Valid usernames can contain letters, numbers, underscores, periods,
hyphens, and at signs.
|
public static boolean isValidName(java.lang.String name_)
name_
- public static boolean isValidNameLength(java.lang.String name_, UserValidationUtils.NameField field_)
name_
- The name string to validatefield_
- Which name field to validate. Should be one of the
NameField enum constants.public static int getNameMaxSize(UserValidationUtils.NameField field_)
field_
- Which name field to validate. Should be one of the
constants XX_FIELD.public static boolean isValidUsername(java.lang.String username_)
username_
- public static boolean isUniqueUsername(java.lang.String username_)
username_
- true
if there is no existing user with the given username_
and the username_
is valid username, returns false otherwise.UserService#isUsernameAvailable(String)}
public static boolean isValidSSN(java.lang.String ssn_)
ssn_
- public static boolean isUniqueSSN(java.lang.String ssn_)
ssn_
- public static boolean changedSSN(java.lang.String ssn_, java.lang.String un_) throws java.lang.Exception
ssn_
- social security numberun_
- usernamejava.lang.Exception
public static boolean isValidEmail(java.lang.String email_)
email_
- public static boolean isValidTitle(java.lang.String title)
title
- public static boolean isEmptyField(java.lang.String str_)
str_
- the value to checkCopyright © 2003-2024 Appian Corporation. All Rights Reserved.