class DatasyncValuable
Represents a tree-like value stored by the Webcom datasync service within its real-time database.
This class provides methods to easily convert it to native primitive or composite types (Boolean, String,
Number, Map, List) or business objects (Serializable
-annotated classes or
POJO classes).
fun <T : Any> converted(): T?
Convenient shortcut to convertTo, which returns |
|
fun <T : Any> convertedAsList(): List<T>?
Convenient shortcut to convertToListOf, which returns |
|
fun <T : Any> convertedAsMap(): Map<String, T>?
Convenient shortcut to convertToMapOf, which returns |
|
fun <T : Any> convertTo(type: KClass<T>): WebcomResult<T>
Converts this DatasyncValuable to a given T type. |
|
fun <T : Any> convertToListOf(type: KClass<T>): WebcomResult<List<T>>
Converts this DatasyncValuable to a List of a given T type. |
|
fun <T : Any> convertToMapOf(type: KClass<T>): WebcomResult<Map<String, T>>
Converts this DatasyncValuable to a Map of a given T type. |
|
fun isNull(): Boolean
Indicates whether this tree-like value is null (or empty). |
|
fun value(): Any?
Returns this tree-like value as a combination of native primitive and composite types (Boolean, String, Number, Map, List). |