Webcom Android SDK Public API Reference / com.orange.webcom.sdkv2.datasync / DatasyncValuable

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

fun <T : Any> converted(): T?

Convenient shortcut to convertTo, which returns null in case of failure.

convertedAsList

fun <T : Any> convertedAsList(): List<T>?

Convenient shortcut to convertToListOf, which returns null in case of failure.

convertedAsMap

fun <T : Any> convertedAsMap(): Map<String, T>?

Convenient shortcut to convertToMapOf, which returns null in case of failure.

convertTo

fun <T : Any> convertTo(type: KClass<T>): WebcomResult<T>

Converts this DatasyncValuable to a given T type.

convertToListOf

fun <T : Any> convertToListOf(type: KClass<T>): WebcomResult<List<T>>

Converts this DatasyncValuable to a List of a given T type.

convertToMapOf

fun <T : Any> convertToMapOf(type: KClass<T>): WebcomResult<Map<String, T>>

Converts this DatasyncValuable to a Map of a given T type.

isNull

fun isNull(): Boolean

Indicates whether this tree-like value is null (or empty).

value

fun value(): Any?

Returns this tree-like value as a combination of native primitive and composite types (Boolean, String, Number, Map, List).