Package-level declarations

Types

Link copied to clipboard
data class YsonTextNode(val value: String, val attrs: Map<String, YsonValue>? = null)

YsonTextNode represents a single character in a Text CRDT, optionally carrying inline attributes.

Link copied to clipboard
data class YsonTreeNode(val type: String, val value: String? = null, val attrs: Map<String, String>? = null, val children: List<YsonTreeNode>? = null)

YsonTreeNode represents a node in a Tree CRDT.

Link copied to clipboard
sealed interface YsonValue

YsonValue represents any valid YSON value.

Functions

Link copied to clipboard
fun isBinData(value: Any?): Boolean

isBinData returns true when value is a YsonValue.YsonBinData.

Link copied to clipboard
fun isCounter(value: Any?): Boolean

isCounter returns true when value is a YsonValue.YsonCounter.

Link copied to clipboard
fun isDate(value: Any?): Boolean

isDate returns true when value is a YsonValue.YsonDate.

Link copied to clipboard
Link copied to clipboard
fun isInt(value: Any?): Boolean

isInt returns true when value is a YsonValue.YsonInt.

Link copied to clipboard
fun isLong(value: Any?): Boolean

isLong returns true when value is a YsonValue.YsonLong.

Link copied to clipboard
fun isObject(value: Any?): Boolean

isObject returns true when value is a plain YsonValue.YsonObject, not a CRDT or special type.

Link copied to clipboard
fun isText(value: Any?): Boolean

isText returns true when value is a YsonValue.YsonText.

Link copied to clipboard
fun isTree(value: Any?): Boolean

isTree returns true when value is a YsonValue.YsonTree.

Link copied to clipboard
fun parse(yson: String): YsonValue

parse parses a YSON formatted string into a typed YsonValue.

Link copied to clipboard
inline fun <T : YsonValue> parseAs(yson: String): T

parseAs parses a YSON formatted string and narrows the result to T.

Link copied to clipboard

textToString returns the concatenated character values of a YsonValue.YsonText.

Link copied to clipboard

treeToXML returns an XML string representation of a YsonValue.YsonTree.