Interface PField
-
- All Known Implementing Classes:
Any._Field,Empty._Field,PApplicationException._Field
public interface PFieldField descriptor. All struct variants contains a set of fields. This interface describes the properties each field has. It is an interface so the fields themselves may be implemented as an enum.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static java.lang.StringasString(PField field)asString helper for fields.java.lang.ObjectgetDefaultValue()PDescriptorgetDescriptor()intgetId()java.lang.StringgetName()PRequirementgetRequirement()default PTypegetType()booleanhasDefaultValue()
-
-
-
Method Detail
-
getId
int getId()
- Returns:
- The field numeric ID or key.
-
getRequirement
@Nonnull PRequirement getRequirement()
- Returns:
- How the field is required for validity.
-
getType
@Nonnull default PType getType()
- Returns:
- The data type of the field.
-
getDescriptor
@Nonnull PDescriptor getDescriptor()
- Returns:
- The type descriptor for the field data type.
-
getName
@Nonnull java.lang.String getName()
- Returns:
- The field name (original).
-
hasDefaultValue
boolean hasDefaultValue()
- Returns:
- Whether the field has an explicit default value.
-
getDefaultValue
java.lang.Object getDefaultValue()
- 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.
-
asString
static java.lang.String asString(PField field)
asString helper for fields.- Parameters:
field- The field to make string of.- Returns:
- The field asString.
-
-