FIELD_TYPE - the field value typepublic abstract class PluginDataField<FIELD_TYPE>
extends java.lang.Object
PluginDataField.FieldType| Modifier and Type | Class and Description |
|---|---|
static class |
PluginDataField.FieldType
Enum of supported field types.
|
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
JSON_FIELD_VALUE |
| Modifier | Constructor and Description |
|---|---|
protected |
PluginDataField(int id,
PluginDataField.FieldType type,
java.lang.String title,
java.lang.String description,
FIELD_TYPE value) |
|
PluginDataField(org.json.JSONObject fieldJson)
Do not use - for internal use only
|
| Modifier and Type | Method and Description |
|---|---|
static PluginDataField<?> |
createNewField(org.json.JSONObject fieldJson)
Do not use - for internal use only
|
java.lang.String |
getDescription()
Gets the field description.
|
protected abstract FIELD_TYPE |
getFieldValue(org.json.JSONObject fieldJson,
java.lang.String jsonFieldValue)
Gets the field value.
|
int |
getId()
Gets the field id.
|
java.lang.String |
getTitle()
Gets the field title.
|
PluginDataField.FieldType |
getType()
Gets the field type.
|
FIELD_TYPE |
getValue()
Gets the field value.
|
org.json.JSONObject |
serialize()
Do not use - for internal use only
|
void |
setValue(FIELD_TYPE fieldValue)
Sets the field value.
|
void |
setValueGeneric(java.lang.Object fieldValue)
Sets the field value.
|
protected static final java.lang.String JSON_FIELD_VALUE
protected PluginDataField(int id,
PluginDataField.FieldType type,
java.lang.String title,
java.lang.String description,
FIELD_TYPE value)
public PluginDataField(org.json.JSONObject fieldJson)
protected abstract FIELD_TYPE getFieldValue(org.json.JSONObject fieldJson, java.lang.String jsonFieldValue)
fieldJson - the field jsonjsonFieldValue - the json field valuepublic int getId()
public PluginDataField.FieldType getType()
public java.lang.String getTitle()
public java.lang.String getDescription()
public FIELD_TYPE getValue()
public void setValueGeneric(java.lang.Object fieldValue)
throws java.lang.ClassCastException
setValue() method of the used subclass.fieldValue - the new field valuejava.lang.ClassCastException - When fieldValue type does not match the generic FIELD_TYPEpublic void setValue(FIELD_TYPE fieldValue)
fieldValue - the new valuepublic org.json.JSONObject serialize()
public static PluginDataField<?> createNewField(org.json.JSONObject fieldJson)