JsonUtil
@UnstableApi
class JsonUtil
Utilities for working with JSON
Summary
Public functions |
|
|---|---|
java-static JSONObject? |
exceptionAsJsonObject(exception: Exception?)Creates a |
java-static JSONObject! |
exportResultAsJsonObject(exportResult: ExportResult!)Creates a |
java-static JSONObject! |
Returns a |
java-static JSONArray! |
processedInputsAsJsonArray(Creates a |
Public functions
exceptionAsJsonObject
java-static fun exceptionAsJsonObject(exception: Exception?): JSONObject?
Creates a JSONObject from the Exception.
If the exception is an ExportException, errorCode is included.
| Returns | |
|---|---|
JSONObject? |
The |
| Throws | |
|---|---|
org.json.JSONException |
if this method attempts to create a JSON with null key. |
exportResultAsJsonObject
java-static fun exportResultAsJsonObject(exportResult: ExportResult!): JSONObject!
Creates a JSONObject from the ExportResult.
| Parameters | |
|---|---|
exportResult: ExportResult! |
The |
| Returns | |
|---|---|
JSONObject! |
The |
| Throws | |
|---|---|
org.json.JSONException |
if this method attempts to create a JSON with null key. |
getDeviceDetailsAsJsonObject
java-static fun getDeviceDetailsAsJsonObject(): JSONObject!
Returns a JSONObject containing device specific details from Build, including manufacturer, model, SDK version and build fingerprint.
| Throws | |
|---|---|
org.json.JSONException |
processedInputsAsJsonArray
java-static fun processedInputsAsJsonArray(
processedInputs: ImmutableList<ExportResult.ProcessedInput!>!
): JSONArray!
Creates a JSONArray from processed inputs.
| Parameters | |
|---|---|
processedInputs: ImmutableList<ExportResult.ProcessedInput!>! |
The list of |
| Returns | |
|---|---|
JSONArray! |
A |
| Throws | |
|---|---|
org.json.JSONException |
if this method attempts to create a JSON with null key. |