public interface BotData
Modifier and Type | Method and Description |
---|---|
void |
addField(java.lang.String section,
java.lang.String field,
java.lang.String val)
Stored a field/value pair under a given section.
|
void |
addRow(java.lang.String section,
java.lang.String[] fields)
Updates an array (of arrays, appending the given items as a
JSONArry of Strings.
|
void |
addToField(java.lang.String section,
java.lang.String field,
int val)
Updates a numeric field, increasing its value by the given amount.
|
org.json.JSONObject |
data()
Get the entire data associated with the bot.
|
java.lang.String |
getField(java.lang.String section,
java.lang.String field)
Fetch value for a field from a given section.
|
void |
remove(java.lang.String section)
Removes the entire section from the persistence layer.
|
org.json.JSONObject data()
void addField(java.lang.String section, java.lang.String field, java.lang.String val)
section
- Section where the field is to be added.field
- field to be added/updatedval
- String value of the fieldjava.lang.String getField(java.lang.String section, java.lang.String field)
section
- Section from where the field is to be pulledfield
- Field for which the value is to be returnedvoid addToField(java.lang.String section, java.lang.String field, int val)
section
- Section where the fields are stored. It helps segregate data for different types of events.field
- The path of the field to be updatedval
- the value by which the field is to be increasedvoid addRow(java.lang.String section, java.lang.String[] fields)
section
- Section where the fields are stored. It helps segregate data for different types of events.fields
- An array of Strings representing the row to be
appendedvoid remove(java.lang.String section)
section
- Section name to be removed