Package-level declarations

Types

Link copied to clipboard

Thrown when a JsonValue is unable to wrap an object or unable to parse a JSON encoded String.

Link copied to clipboard

An immutable list of JsonValues.

Link copied to clipboard

An immutable mapping of String keys to JsonValues.

Link copied to clipboard

Class representing the leaf node of a JsonPredicate that contains the relevant field matching info.

Link copied to clipboard

Class abstracting a JSON predicate. The predicate is contained to the following schema:

Link copied to clipboard
fun interface JsonSerializable

Interface for classes whose instances can be written as a JsonValue.

Link copied to clipboard

A JsonValue is a representation of any value that can be described using JSON. It can contain one of the following: a JsonMap, a JsonList, a Number, a Boolean, String, or it can contain null.

Link copied to clipboard

Class representing the field matching type and values contained in a JsonMatcher.

Functions

Link copied to clipboard

Convenience method to create an empty JsonList.

Link copied to clipboard

Convenience method to create an empty JsonMap.

Link copied to clipboard
fun jsonListOf(vararg values: Any): JsonList
Link copied to clipboard
fun jsonMapOf(vararg fields: Pair<String, *>): JsonMap

Inherited functions

Link copied to clipboard
fun JsonMap.extend(vararg fields: Pair<String, *>): JsonMap
Link copied to clipboard
fun JsonMap.isoDateAsMilliseconds(key: String, defaultValue: Long? = null): Long?

Gets the field with the given key and parses it as a ISO date string.

Link copied to clipboard
inline fun <T> JsonMap.optionalField(key: String): T?

Gets the field with the given key from the JsonMap, or null if not defined.

Link copied to clipboard

Gets a list with the given key from the JsonMap, or an null if not defined.

Link copied to clipboard

Gets a map with the given key from the JsonMap, or an null if not defined.

Link copied to clipboard
inline fun <T> JsonMap.requireField(key: String): T

Gets the field with the given key from the JsonMap, ensuring it is non-null.

Link copied to clipboard

Gets a list with the given key from the JsonMap.

Link copied to clipboard

Gets a map with the given key from the JsonMap.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T, R : JsonSerializable> R.tryParse(logError: Boolean = false, parser: (R) -> T): T?