DatasyncValuable

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).

Functions

converted
Link copied to clipboard
inline fun <T : Any> converted(): T?
Convenient shortcut to convertTo, which returns null in case of failure.
convertedAsList
Link copied to clipboard
inline fun <T : Any> convertedAsList(): List<T>?
Convenient shortcut to convertToListOf, which returns null in case of failure.
convertedAsMap
Link copied to clipboard
inline fun <T : Any> convertedAsMap(): Map<String, T>?
Convenient shortcut to convertToMapOf, which returns null in case of failure.
convertTo
Link copied to clipboard
fun <T : Any> convertTo(type: KClass<T>): WebcomResult<T>
Converts this DatasyncValuable to a given T type.
convertToListOf
Link copied to clipboard
fun <T : Any> convertToListOf(type: KClass<T>): WebcomResult<List<T>>
Converts this DatasyncValuable to a List of a given T type.
convertToMapOf
Link copied to clipboard
fun <T : Any> convertToMapOf(type: KClass<T>): WebcomResult<Map<String, T>>
Converts this DatasyncValuable to a Map of a given T type.
isNull
Link copied to clipboard
fun isNull(): Boolean
Indicates whether this tree-like value is null (or empty).
value
Link copied to clipboard
fun value(): Any?
Returns this tree-like value as a combination of native primitive and composite types (Boolean, String, Number, Map, List).