Dictionary

expect open class Dictionary : Iterable<String> (source)

Dictionary provides readonly access to dictionary data.

Inheritors

actual open class Dictionary : DelegatedClass<<Error class: unknown class>> , Iterable<String> (source)

Inheritors

actual open class Dictionary : Iterable<String> (source)

Inheritors

Properties

Link copied to clipboard
expect val count: Int

The number of the entries in the dictionary.

actual val count: Int
actual val count: Int
Link copied to clipboard
expect val keys: List<String>

A List containing all keys, or an empty List if the dictionary has no properties.

actual val keys: List<String>
actual val keys: List<String>

Functions

Link copied to clipboard
expect operator fun contains(key: String): Boolean

Tests whether a property exists or not. This can be less expensive than getValue(String), because it does not have to allocate an Object for the property value.

actual operator fun contains(key: String): Boolean
actual operator fun contains(key: String): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun Dictionary.get(key: String): Fragment

Subscript access to a Fragment object by key.

Link copied to clipboard
expect open fun getArray(key: String): Array?

Get a property's value as an Array. Returns null if the property doesn't exist, or its value is not an array.

actual open fun getArray(key: String): Array?
actual open fun getArray(key: String): Array?
Link copied to clipboard
expect fun getBlob(key: String): Blob?

Gets a property's value as a Blob. Returns null if the value doesn't exist, or its value is not a Blob.

actual fun getBlob(key: String): Blob?
actual open fun getBlob(key: String): Blob?
Link copied to clipboard
expect fun getBoolean(key: String): Boolean

Gets a property's value as a boolean. Returns true if the value exists, and is either true or a nonzero number.

actual fun getBoolean(key: String): Boolean
actual fun getBoolean(key: String): Boolean
Link copied to clipboard
expect fun getDate(key: String): Instant?

Gets a property's value as an Instant date. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns null if the value doesn't exist, is not a string, or is not parsable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds.

actual fun getDate(key: String): Instant?
actual fun getDate(key: String): Instant?
Link copied to clipboard
expect open fun getDictionary(key: String): Dictionary?

Get a property's value as a Dictionary. Returns null if the property doesn't exist, or its value is not a dictionary.

actual open fun getDictionary(key: String): Dictionary?
actual open fun getDictionary(key: String): Dictionary?
Link copied to clipboard
expect fun getDouble(key: String): Double

Gets a property's value as a double. Integers will be converted to double. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the property doesn't exist or does not have a numeric value.

actual fun getDouble(key: String): Double
actual fun getDouble(key: String): Double
Link copied to clipboard
expect fun getFloat(key: String): Float

Gets a property's value as a float. Integers will be converted to float. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the value doesn't exist or does not have a numeric value.

actual fun getFloat(key: String): Float
actual fun getFloat(key: String): Float
Link copied to clipboard
expect fun getInt(key: String): Int

Gets a property's value as an int. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

actual fun getInt(key: String): Int
actual fun getInt(key: String): Int
Link copied to clipboard
expect fun getLong(key: String): Long

Gets a property's value as a long. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

actual fun getLong(key: String): Long
actual fun getLong(key: String): Long
Link copied to clipboard
expect fun getNumber(key: String): Number?

Gets a property's value as a Number. Returns null if the value doesn't exist, or its value is not a Number.

actual fun getNumber(key: String): Number?
actual fun getNumber(key: String): Number?
Link copied to clipboard
expect fun getString(key: String): String?

Gets a property's value as a String. Returns null if the value doesn't exist, or its value is not a String.

actual fun getString(key: String): String?
actual fun getString(key: String): String?
Link copied to clipboard
expect fun getValue(key: String): Any?

Gets a property's value as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or nil if the property value is null or the property doesn't exist.

actual open fun getValue(key: String): Any?
actual open fun getValue(key: String): Any?
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
Link copied to clipboard
expect open operator override fun iterator(): Iterator<String>

An iterator over keys of this Dictionary. A call to the next() method of the returned iterator will throw a ConcurrentModificationException, if the MutableDictionary is modified while it is in use.

actual open operator override fun iterator(): Iterator<String>
actual open operator override fun iterator(): Iterator<String>
Link copied to clipboard
expect fun toJSON(): String
actual fun toJSON(): String
actual open fun toJSON(): String
Link copied to clipboard
expect fun toMap(): Map<String, Any?>

Gets content of the current object as a Map. The values contained in the returned Map object are all JSON based values.

actual fun toMap(): Map<String, Any?>
actual fun toMap(): Map<String, Any?>
Link copied to clipboard

Return a mutable copy of the dictionary

Link copied to clipboard
open override fun toString(): String
open override fun toString(): String