Package net.morimekta.providence
Enum PApplicationException._Field
- java.lang.Object
-
- java.lang.Enum<PApplicationException._Field>
-
- net.morimekta.providence.PApplicationException._Field
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PApplicationException._Field>
,PField
- Enclosing class:
- PApplicationException
public static enum PApplicationException._Field extends java.lang.Enum<PApplicationException._Field> implements PField
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PApplicationException._Field
fieldForId(int id)
static PApplicationException._Field
fieldForName(java.lang.String name)
static PApplicationException._Field
findById(int id)
static PApplicationException._Field
findByName(java.lang.String name)
java.lang.Object
getDefaultValue()
PDescriptor
getDescriptor()
int
getId()
java.lang.String
getName()
PRequirement
getRequirement()
boolean
hasDefaultValue()
java.lang.String
toString()
static PApplicationException._Field
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PApplicationException._Field[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MESSAGE
public static final PApplicationException._Field MESSAGE
-
ID
public static final PApplicationException._Field ID
-
-
Method Detail
-
values
public static PApplicationException._Field[] 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 (PApplicationException._Field c : PApplicationException._Field.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PApplicationException._Field 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
-
getId
public int getId()
-
getRequirement
public PRequirement getRequirement()
- Specified by:
getRequirement
in interfacePField
- Returns:
- How the field is required for validity.
-
getDescriptor
public PDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfacePField
- Returns:
- The type descriptor for the field data type.
-
getName
public java.lang.String getName()
-
hasDefaultValue
public boolean hasDefaultValue()
- Specified by:
hasDefaultValue
in interfacePField
- Returns:
- Whether the field has an explicit default value.
-
getDefaultValue
public java.lang.Object getDefaultValue()
- Specified by:
getDefaultValue
in interfacePField
- Returns:
- The default value or null if none. This should return value also where the field has an implicit default value, e.g. numerical types.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<PApplicationException._Field>
-
findById
public static PApplicationException._Field findById(int id)
- Parameters:
id
- Field name- Returns:
- The identified field or null
-
findByName
public static PApplicationException._Field findByName(java.lang.String name)
- Parameters:
name
- Field name- Returns:
- The named field or null
-
fieldForId
public static PApplicationException._Field fieldForId(int id)
- Parameters:
id
- Field name- Returns:
- The identified field
- Throws:
java.lang.IllegalArgumentException
- If no such field
-
fieldForName
public static PApplicationException._Field fieldForName(java.lang.String name)
- Parameters:
name
- Field name- Returns:
- The named field
- Throws:
java.lang.IllegalArgumentException
- If no such field
-
-