Enum Class UserLocaleString

java.lang.Object
java.lang.Enum<UserLocaleString>
com.iizix.user.UserLocaleString
All Implemented Interfaces:
IEnumLocaleString, Serializable, Comparable<UserLocaleString>, Constable

public enum UserLocaleString extends Enum<UserLocaleString> implements IEnumLocaleString
Locale strings for operations dealing with a user. These locale strings are typically used to localize the text.
Author:
Christopher Mindus
  • Enum Constant Details

    • UserNameNotFound

      public static final UserLocaleString UserNameNotFound
      User name not found. It is up to the application to decide if this information should be presented to the user or if it should just stay silent about the error.

      English: "User name not found".

    • EmailNotFound

      public static final UserLocaleString EmailNotFound
      Email not found. This error is generated because a user was not found when looking her/him up using an email address. It is up to the application to decide if this information should be presented to the user or if it should just stay silent about the error.

      English: "Email not found".

    • FixedPassword

      public static final UserLocaleString FixedPassword
      User cannot change password. An administrator has configured the password to be fixed.

      English: "You cannot change your password, it is set to fixed password by administrator's action".

    • SpecifyPassword

      public static final UserLocaleString SpecifyPassword
      Password must be specified but is empty or blank.

      English: "Password must be specified".

    • SpecifyNewPassword

      public static final UserLocaleString SpecifyNewPassword
      Changed password must be specified to sign in but is empty or blank.

      English: "New password must be specified".

    • PasswordChangeRequired

      public static final UserLocaleString PasswordChangeRequired
      Sign in requires a change of password.

      English "Password change is required to sign in".

    • PassordPolicyMismatch

      public static final UserLocaleString PassordPolicyMismatch
      Password policy is not met. This error generally contains an additional string parameter with more information. This parameter string is generally localized using the current thread's locale for a user session.

      English "Password does not meet minimum requirements".

    • HashedPasswordMismatch

      public static final UserLocaleString HashedPasswordMismatch
      Hashed password mismatch.

      English: "Your old password does not match".

    • DatabaseError

      public static final UserLocaleString DatabaseError
      Database error. The server event log contains more information.

      English: "A database error occurred".

    • SystemError

      public static final UserLocaleString SystemError
      System error. The server event log contains more information.

      English: "A system error occurred".

  • Field Details

    • PREFIX

      public static final String PREFIX
      The prefix for all text IDs: "ci.user_". "ci." stands for the shortened package name "com.iizix.".
      See Also:
    • id

      public final String id
      The text ID of the string, starting with the PREFIX "ci.user_" and the Enum.name() appended to it. "ci." stands for the shortened package name "com.iizix.".
    • english

      public final String english
      The English default text.
  • Method Details

    • values

      public static UserLocaleString[] 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 UserLocaleString 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
    • getID

      public String getID()
      Gets the text ID.
      Specified by:
      getID in interface IEnumLocaleString
      Returns:
      The text ID string.
    • getFallback

      public String getFallback()
      Gets the fallback String.
      Specified by:
      getFallback in interface IEnumLocaleString
      Returns:
      The fallback string.
    • asID

      public String asID(String param)
      Gets the ID of this locale string with the appended string parameter.
      Parameters:
      param - The string parameter to append.
      Returns:
      The UserLocaleString formatted as id + ':' + param.
    • from

      public static UserLocaleString from(String id) throws NotFoundException
      Parses the ID string to find a matching ID. If none is found, a NotFoundException is thrown.
      Parameters:
      id - The ID to parse. An ID may contain an additional string appended to this id prefixed with ':', typically for error messages. When looking for the ID, the part of the ID from a potential colon ':' is removed.
      Returns:
      A non-null UserLocaleString instance.
      Throws:
      NotFoundException - If the id is not found.
      NullPointerException - If id is null.
    • fromNonNull

      public static UserLocaleString fromNonNull(String id)
      Parses the ID string to find a matching ID. If none is found, SystemError is returned but before returning it, the event is logged in the server with and exception to provide a stack trace.
      Parameters:
      id - The ID to parse. An ID may contain an additional string appended to this id prefixed with ':', typically for error messages. When looking for the ID, the part of the ID from a potential colon ':' is removed.
      Returns:
      A non-null UserLocaleString instance matching the id, or SystemError if not found.
      Throws:
      NullPointerException - If id is null.