public abstract class Data
extends java.lang.Object
DataGatherer
instance.
Any piece of gathered data must support being converted to JSON, which can then later be stored
in some kind of database.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY |
static java.lang.String |
TIMESTAMP |
Modifier | Constructor and Description |
---|---|
protected |
Data() |
Modifier and Type | Method and Description |
---|---|
protected abstract javax.json.JsonObjectBuilder |
convertToJson()
Converts this piece of data to JSON, which is then suitable of being stored in a database.
|
javax.json.JsonObject |
getAnnotatedJson()
Gets the JSON object representing this data object, including a timestamp which
represents when this data object was created and a key.
|
protected abstract java.lang.String |
getKey()
Returns a key with which data of this type can be identified.
|
public static final java.lang.String TIMESTAMP
public static final java.lang.String KEY
public final javax.json.JsonObject getAnnotatedJson()
TIMESTAMP
to the resulting JSON object, in the form of an ISO-8601 String.
The key is added with the key KEY
to the resulting JSON object, and the value
corresponds to getKey()
.protected abstract javax.json.JsonObjectBuilder convertToJson()
getAnnotatedJson()
and
a time stamp is added to the object.protected abstract java.lang.String getKey()