Package com.iizix.user
Enum UserLocaleString
- java.lang.Object
- java.lang.Enum<UserLocaleString>
- com.iizix.user.UserLocaleString
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<UserLocaleString>
public enum UserLocaleString extends java.lang.Enum<UserLocaleString>
Locale strings for operations dealing with a user. These locale strings are typically used to localize the text.- Author:
- Christopher Mindus
Enum Constant Summary
Enum Constants Enum Constant Description DatabaseError
Database error.EmailNotFound
Email not found.FixedPassword
User cannot change password.HashedPasswordMismatch
Hashed password mismatch.PassordPolicyMismatch
Password policy is not met.PasswordChangeRequired
Sign in requires a change of password.SpecifyNewPassword
Changed password must be specified to sign in but is empty or blank.SpecifyPassword
Password must be specified but is empty or blank.SystemError
System error.UserNameNotFound
User name not found.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asID(java.lang.String param)
Gets the ID of this locale string with the appended string parameter.static UserLocaleString
from(java.lang.String id)
Parses the ID string to find a matching ID.static UserLocaleString
fromNonNull(java.lang.String id)
Parses the ID string to find a matching ID.static UserLocaleString
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static UserLocaleString[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Detail
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 Detail
PREFIX
public static final java.lang.String PREFIX
The prefix for all text IDs: "ci.user_"."ci."
stands for the shortened package name"com.iizix."
.- See Also:
- Constant Field Values
id
public final java.lang.String id
The text ID of the string, starting with thePREFIX
"ci.user_" and theEnum.name()
appended to it."ci."
stands for the shortened package name"com.iizix."
.
english
public final java.lang.String english
The English default text.
Method Detail
values
public static UserLocaleString[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (UserLocaleString c : UserLocaleString.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
valueOf
public static UserLocaleString valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
asID
public java.lang.String asID(java.lang.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(java.lang.String id) throws NotFoundException
Parses the ID string to find a matching ID. If none is found, aNotFoundException
is thrown.- Parameters:
id
- The ID to parse. An ID may contain an additional string appended to thisid
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 theid
is not found.java.lang.NullPointerException
- Ifid
isnull
.
fromNonNull
public static UserLocaleString fromNonNull(java.lang.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 thisid
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 theid
, orSystemError
if not found. - Throws:
java.lang.NullPointerException
- Ifid
isnull
.