Class UserValidationUtils

java.lang.Object
com.appiancorp.suiteapi.personalization.UserValidationUtils

public class UserValidationUtils extends Object
  • Constructor Details

    • UserValidationUtils

      public UserValidationUtils()
  • Method Details

    • isValidName

      public static boolean isValidName(String name_)
      Valid names can contains letters, numbers, underscores, hyphens, and whitespace. Names are not always required, so an empty field is also considered valid.
      Parameters:
      name_ -
      Returns:
      true if the name is valid
    • isValidNameLength

      public static boolean isValidNameLength(String name_, UserValidationUtils.NameField field_)
      Returns true if name is a valid length
      Parameters:
      name_ - The name string to validate
      field_ - Which name field to validate. Should be one of the NameField enum constants.
      Returns:
      true if the name is a valid length
    • getNameMaxSize

      public static int getNameMaxSize(UserValidationUtils.NameField field_)
      Returns the max character size for the given name field
      Parameters:
      field_ - Which name field to validate. Should be one of the constants XX_FIELD.
      Returns:
      max size for field
    • isValidUsername

      public static boolean isValidUsername(String username_)
      Valid usernames can contain letters, numbers, underscores, periods, hyphens, and at signs. Usernames are required and cannot be left empty.
      Parameters:
      username_ -
      Returns:
      true if the username is valid
    • isUniqueUsername

      public static boolean isUniqueUsername(String username_)
      Returns true if the username is valid and there is no existing user that has the same username (case-insensitive).
      Parameters:
      username_ -
      Returns:
      returns true if there is no existing user with the given username_ and the username_ is valid username, returns false otherwise.
    • isValidSSN

      public static boolean isValidSSN(String ssn_)
      Valid ssns consist of 9 digits. No spaces or dashes allowed. SSNs are not required, so an empty field is considered valid.
      Parameters:
      ssn_ -
      Returns:
      true if the ssn is in a valid format
    • isUniqueSSN

      public static boolean isUniqueSSN(String ssn_)
      Returns true is there is no existing user with this ssn. SSNs are not required, so an empty field is considered valid.
      Parameters:
      ssn_ -
      Returns:
      true if there is no existing user with this ssn
    • changedSSN

      public static boolean changedSSN(String ssn_, String un_) throws Exception
      Returns true if the given ssn is different from the ssn currently associated with the given username.
      Parameters:
      ssn_ - social security number
      un_ - username
      Returns:
      Throws:
      Exception
    • isValidEmail

      public static boolean isValidEmail(String email_)
      Returns true if the given email is valid. The email address is required and cannot be left empty.
      Parameters:
      email_ -
      Returns:
    • isValidTitle

      public static boolean isValidTitle(String title)
      Valid titles can contain letters, underscores, hyphens, whitespace, and if specified numbers. Titles are not required, so an empty field is also considered valid.
      Parameters:
      title -
      Returns:
      true if the title is valid
    • isEmptyField

      public static boolean isEmptyField(String str_)
      This returns true if a user field is empty. This should only be used to validate whether a user field is empty, and not as a generic check for null or empty string.
      Parameters:
      str_ - the value to check
      Returns:
      true if the value is empty