GenericElement

A generalized element for deferred deserialization for use as an interoperable stand in for JSON and YAML nodes.

Report a problem

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val element: Any

The underlying element.

Link copied to clipboard

The serializer used to deserialize the element.

Functions

Link copied to clipboard
inline fun <T> GenericElement.asA(): T

Deserialize an element to the given type T.

Link copied to clipboard
abstract fun <T> deserialize(serializer: DeserializationStrategy<T>): T

Deserializes the element into the given serializer.

Link copied to clipboard

If this is a map, return a list of key-value entries.

Link copied to clipboard
open fun isArray(): Boolean

Returns true if the element is a JSON array.

Link copied to clipboard
open fun isObject(): Boolean

Returns true if the element is a JSON object.

Link copied to clipboard
open fun isString(): Boolean

Returns true if the element is a JSON primitive and is a string.

Link copied to clipboard
abstract fun items(): List<GenericElement>

If this is a list, return all elements.

Link copied to clipboard

Returns the empty element if the given element is null, otherwise returns the element.

Link copied to clipboard
open operator fun plus(other: GenericElement): GenericElement

Merges two elements into a single element with the keys of both.