java.lang.Object
de.grogra.api.APIReturn
This class is mainly a wrapper for a JSON object, therefore it is possible to add values to free or predefined fields.
This fields can than parse to a JSONString and therefore can be transfered through the web server
Additionally the status of the return can be set as a boolean to define if the request was successful
- Author:
- Tim Oberländer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Creating a JSONArray from a array of Strings and adding it, to the return data based on the given key.void
addList
(String key, StackTraceElement[] values) Creating a JSONArray from a array of Strings and adding it, to the return data based on the given key.void
adding a String value, repented by a key, to the return data.void
void
addPoint
(String key, JSONObject obj) toString()
encoding the data to a JSON repsentation
-
Constructor Details
-
APIReturn
public APIReturn()Initialize the JSONObject
-
-
Method Details
-
addPoint
adding a String value, repented by a key, to the return data.- Parameters:
key
-objects
-
-
addPoint
-
addPoint
-
addList
Creating a JSONArray from a array of Strings and adding it, to the return data based on the given key.- Parameters:
key
-keys
-
-
addList
Creating a JSONArray from a array of Strings and adding it, to the return data based on the given key.- Parameters:
key
-keys
-
-
toString
encoding the data to a JSON repsentation
-