JsonMap

An immutable mapping of String keys to JsonValues.

Constructors

Link copied to clipboard
constructor(@Nullable map: Map<String, JsonValue>)
Creates a JsonMap from a Map.

Types

Link copied to clipboard
open class Builder
Builder class for com.urbanairship.json.JsonMap Objects.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun containsKey(@NonNull key: String): Boolean
Returns whether this map contains the specified key.
Link copied to clipboard
Returns whether this map contains the specified value.
Link copied to clipboard
Returns a set containing all of the mappings in this map.
Link copied to clipboard
open fun equals(@Nullable object: Any): Boolean
Link copied to clipboard
open fun get(@NonNull key: String): JsonValue
Returns the value of the mapping with the specified key.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun isEmpty(): Boolean
Returns whether this map is empty.
Link copied to clipboard
open fun isNotEmpty(): Boolean
Returns whether this map is not empty.
Link copied to clipboard
Link copied to clipboard
open fun keySet(): Set<String>
Returns a set of the keys contained in this map.
Link copied to clipboard
Factory method to create a new JSON map builder.
Link copied to clipboard
open fun opt(@NonNull key: String): JsonValue
Returns the optional value in the map with the specified key.
Link copied to clipboard
Returns the required value in the map with the specified key.
Link copied to clipboard
open fun size(): Int
Returns the number of elements in this map.
Link copied to clipboard
Returns the objects represented as a JsonValue.
Link copied to clipboard
open fun toString(): String
Returns the JsonMap as a JSON encoded String.
open fun toString(@NonNull sortKeys: Boolean): String
Returns the JsonMap as a JSON encoded String with sorted keys.
Link copied to clipboard
Returns a collection of the values contained in this map.

Inherited functions

Link copied to clipboard
fun JsonMap.extend(vararg fields: Pair<String, *>): JsonMap
Link copied to clipboard
open fun forEach(action: Consumer<in T>)
Link copied to clipboard

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