DataItem
Immutable data class for restricting the supported types that can be passed into the system.
The toString() method will provide a JSON friendly representation of the data enclosed. That is,
String data will be quoted; i.e. "my string"
Numeric data will not be quoted; i.e. 10 or 3.141..
Boolean data will not be quoted; i.e. true/false
DataList data will be formatted as a JSON Array; i.e. ["value", 10, true]
DataObject data will be formatted as a JSON Object; i.e. { "key":"value", "number":10 }
This class is currently broadly similar to the JSONObject and makes use of several methods provided by the org.json package on Android.
The any value should be restricted to only JSON supportable types - see convert.
The string parameter should only be used in the case where this value is being lazily instantiated from an already stringified representation of the value. If provided, then the string parameter will be used as the pre-computed return value from toString as well
Parameters
Properties
Functions
Should return an instance of a DataItem that represents all required properties of the implementing class, such that it could be:
Returns a ParcelableDataItem that wraps the DataItem.
Returns the contained value as an DataObject if the contained value is a DataObject.
Indicates whether the contained value is a DataList
Indicates whether the contained value is a DataObject