org.starhope.appius.mb
Enum MBErrorReason

java.lang.Object
  extended by java.lang.Enum<MBErrorReason>
      extended by org.starhope.appius.mb.MBErrorReason
All Implemented Interfaces:
Serializable, Comparable<MBErrorReason>

public enum MBErrorReason
extends Enum<MBErrorReason>

WRITEME: Document this type.

Author:
brpocock@star-hope.org

Enum Constant Summary
ALREADY_USED
          The requested entry is already in use, e.g.
BLANK
          The field was left blank, and is required
CONFIRM
          The confirmation of a field failed; for eMail or password entries that have to be entered twice
FORMAT
          The field does not meet format requirements, e.g.
INCORRECT
          The value provided was incorrect or invalid
PASSWORD_EQ_USERNAME
          Password cannot be set to match username
TOO_LONG
          Value is too long
TOO_SHORT
          Value (likely user name or password) was too short.
 
Field Summary
private  String defaultMessageFormat
          Format string for default message creation (in English)
 
Method Summary
 String getErrorMessage(org.starhope.appius.mb.fields.MBFieldIdent field)
          Get an error message.
static MBErrorReason valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MBErrorReason[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BLANK

public static final MBErrorReason BLANK
The field was left blank, and is required


CONFIRM

public static final MBErrorReason CONFIRM
The confirmation of a field failed; for eMail or password entries that have to be entered twice


INCORRECT

public static final MBErrorReason INCORRECT
The value provided was incorrect or invalid


PASSWORD_EQ_USERNAME

public static final MBErrorReason PASSWORD_EQ_USERNAME
Password cannot be set to match username


FORMAT

public static final MBErrorReason FORMAT
The field does not meet format requirements, e.g. too short, not enough unique chars, &c.


ALREADY_USED

public static final MBErrorReason ALREADY_USED
The requested entry is already in use, e.g. someone else has registered with a certain login, or eMail, or whatever


TOO_SHORT

public static final MBErrorReason TOO_SHORT
Value (likely user name or password) was too short.


TOO_LONG

public static final MBErrorReason TOO_LONG
Value is too long

Field Detail

defaultMessageFormat

private final String defaultMessageFormat
Format string for default message creation (in English)

Method Detail

values

public static MBErrorReason[] 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 (MBErrorReason c : MBErrorReason.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MBErrorReason valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getErrorMessage

public String getErrorMessage(org.starhope.appius.mb.fields.MBFieldIdent field)
Get an error message. This will look for (lower-cased) mb.FIELD.REASON as the text, but will fall back upon the default message provided by the reason with the field's friendly name inserted.

Parameters:
field - the field for which an error message is wanted
Returns:
the error message text