public abstract class AbstractDataObject extends Object implements DataObject
DataObject implementations.| Constructor and Description |
|---|
AbstractDataObject() |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(String field)
Retrieves value of the field with the given name.
|
protected void |
readField(JsonReader in,
String field)
Reads the given field from the given input.
|
protected void |
readFields(JsonReader in)
Reads all fields of this instance from the given input.
|
void |
set(String field,
Object value)
Sets the value of the field with the given name.
|
String |
toString() |
protected void |
writeContent(JsonWriter out)
Writes a JSON object containing keys for all fields of this object.
|
protected void |
writeFields(JsonWriter out)
Writes all fields of this instance to the given output.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwriteTopublic Object get(String field)
DataObjectget in interface DataObjectfield - The name of the field.public void set(String field, Object value)
DataObjectset in interface DataObjectfield - The name of the field to update.value - The new value of the field.protected final void writeContent(JsonWriter out) throws IOException
out - The writer to write to.IOExceptionprotected void writeFields(JsonWriter out) throws IOException
out - The writer to write to.IOException - If writing fails.protected final void readFields(JsonReader in) throws IOException
in - The reader to take the input from.IOExceptionprotected void readField(JsonReader in, String field) throws IOException
in - The reader to take the value from.field - The name of the field whose value should be read.IOExceptionCopyright © 2021. All rights reserved.