Package net.morimekta.providence.model
Enum FieldType._Field
- java.lang.Object
-
- java.lang.Enum<FieldType._Field>
-
- net.morimekta.providence.model.FieldType._Field
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<FieldType._Field>
,PField<FieldType>
- Enclosing class:
- FieldType
public static enum FieldType._Field extends java.lang.Enum<FieldType._Field> implements PField<FieldType>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANNOTATIONS
DEFAULT_VALUE
DOCUMENTATION
ID
NAME
REQUIREMENT
TYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FieldType._Field
fieldForId(int id)
static FieldType._Field
fieldForName(java.lang.String name)
static FieldType._Field
fieldForPojoName(java.lang.String name)
static FieldType._Field
findById(int id)
static FieldType._Field
findByName(java.lang.String name)
static FieldType._Field
findByPojoName(java.lang.String name)
PStructDescriptor
getArgumentsType()
If present, is the params type to be used for parameterizable field content, e.g. with GraphQL.java.lang.Object
getDefaultValue()
PDescriptor
getDescriptor()
int
getId()
java.lang.String
getName()
java.lang.String
getPojoName()
PRequirement
getRequirement()
boolean
hasDefaultValue()
PMessageDescriptor<FieldType>
onMessageType()
The message type the field is on.java.lang.String
toString()
static FieldType._Field
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FieldType._Field[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DOCUMENTATION
public static final FieldType._Field DOCUMENTATION
-
ID
public static final FieldType._Field ID
-
REQUIREMENT
public static final FieldType._Field REQUIREMENT
-
TYPE
public static final FieldType._Field TYPE
-
NAME
public static final FieldType._Field NAME
-
DEFAULT_VALUE
public static final FieldType._Field DEFAULT_VALUE
-
ANNOTATIONS
public static final FieldType._Field ANNOTATIONS
-
-
Method Detail
-
values
public static FieldType._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 (FieldType._Field c : FieldType._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 FieldType._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
@Nonnull public PRequirement getRequirement()
- Specified by:
getRequirement
in interfacePField<FieldType>
- Returns:
- How the field is required for validity.
-
getDescriptor
@Nonnull public PDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfacePField<FieldType>
- Returns:
- The type descriptor for the field data type.
-
getArgumentsType
@Nullable public PStructDescriptor getArgumentsType()
Description copied from interface:PField
If present, is the params type to be used for parameterizable field content, e.g. with GraphQL.- Specified by:
getArgumentsType
in interfacePField<FieldType>
- Returns:
- The params type, or null if not parameterizable.
-
getName
@Nonnull public java.lang.String getName()
-
getPojoName
@Nonnull public java.lang.String getPojoName()
- Specified by:
getPojoName
in interfacePField<FieldType>
- Returns:
- The field's pojo name.
-
hasDefaultValue
public boolean hasDefaultValue()
- Specified by:
hasDefaultValue
in interfacePField<FieldType>
- Returns:
- Whether the field has an explicit default value.
-
getDefaultValue
@Nullable public java.lang.Object getDefaultValue()
- Specified by:
getDefaultValue
in interfacePField<FieldType>
- 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.
-
onMessageType
@Nonnull public PMessageDescriptor<FieldType> onMessageType()
Description copied from interface:PField
The message type the field is on.- Specified by:
onMessageType
in interfacePField<FieldType>
- Returns:
- The fields message type.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<FieldType._Field>
-
findById
public static FieldType._Field findById(int id)
- Parameters:
id
- Field ID- Returns:
- The identified field or null
-
findByName
public static FieldType._Field findByName(java.lang.String name)
- Parameters:
name
- Field name- Returns:
- The named field or null
-
findByPojoName
public static FieldType._Field findByPojoName(java.lang.String name)
- Parameters:
name
- Field POJO name- Returns:
- The named field or null
-
fieldForId
public static FieldType._Field fieldForId(int id)
- Parameters:
id
- Field ID- Returns:
- The identified field
- Throws:
java.lang.IllegalArgumentException
- If no such field
-
fieldForName
public static FieldType._Field fieldForName(java.lang.String name)
- Parameters:
name
- Field name- Returns:
- The named field
- Throws:
java.lang.IllegalArgumentException
- If no such field
-
fieldForPojoName
public static FieldType._Field fieldForPojoName(java.lang.String name)
- Parameters:
name
- Field POJO name- Returns:
- The named field
- Throws:
java.lang.IllegalArgumentException
- If no such field
-
-