DynamicDataMap
open class DynamicDataMap
MutableDynamicDataMap |
A mutable heterogeneous map of |
A heterogeneous map of DynamicType keys to their corresponding values. This (and MutableDynamicDataMap) act like Map (and MutableMap), but with type safety for key and value pairs.
Summary
Public functions |
|
|---|---|
inline operator Boolean |
<T : DynamicBuilders.DynamicType> contains(key: DynamicDataKey<T>)Returns true if this map contains the specified |
Boolean |
<T : DynamicBuilders.DynamicType> contains(Returns true if this map contains the specified |
open operator Boolean |
|
operator Boolean? |
Gets the boolean value mapped to |
operator Color? |
Gets the color value mapped to |
operator Duration? |
|
operator Float? |
Gets the float value mapped to |
operator Instant? |
|
operator Int? |
Gets the integer value mapped to |
operator String? |
Gets the string value mapped to |
open Int |
hashCode() |
operator DynamicDataMap |
plus(rhs: DynamicDataMap) |
open String |
toString() |
Public properties |
|
|---|---|
Set<Map.Entry<DynamicDataKey<DynamicBuilders.DynamicType>, DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicType>>> |
Returns a read-only |
Set<DynamicDataKey<DynamicBuilders.DynamicType>> |
Returns a read-only |
Int |
Returns the number of key/value pairs in the map. |
Collection<DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicType>> |
Returns a read-only |
Public functions
contains
inline operator fun <T : DynamicBuilders.DynamicType> contains(key: DynamicDataKey<T>): Boolean
Returns true if this map contains the specified key and it is associated with the specified type T.
| Parameters | |
|---|---|
<T : DynamicBuilders.DynamicType> |
the type to match the value's type against. Dynamic and raw types can be used interchangeably. For example |
key: DynamicDataKey<T> |
the key to check for. |
contains
fun <T : DynamicBuilders.DynamicType> contains(
key: DynamicDataKey<T>,
type: Class<T>
): Boolean
Returns true if this map contains the specified key and it is associated with the specified type.
| Parameters | |
|---|---|
key: DynamicDataKey<T> |
the key to check for. |
type: Class<T> |
the type to match the value's type against. Dynamic and raw types can be used interchangeably. For example |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicBool>): Boolean?
Gets the boolean value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if a non-boolean value is stored with the same name as |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicColor>): Color?
Gets the color value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if a non-color value is stored with the same name as |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicDuration>): Duration?
Gets the Duration value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if a non- |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicFloat>): Float?
Gets the float value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if the key is not stored in the map. |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicInstant>): Instant?
Gets the Instant value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalStateException |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicInt32>): Int?
Gets the integer value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if a non-integer value is stored with the same name as |
get
operator fun get(key: DynamicDataKey<DynamicBuilders.DynamicString>): String?
Gets the string value mapped to key. If there isn't any mapped value for key, returns null.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if a non-string value is stored with the same name as |
Public properties
entries
val entries: Set<Map.Entry<DynamicDataKey<DynamicBuilders.DynamicType>, DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicType>>>
Returns a read-only Set of all key/value pairs in this map.
keys
val keys: Set<DynamicDataKey<DynamicBuilders.DynamicType>>
Returns a read-only Set of all keys in this map.
values
val values: Collection<DynamicDataBuilders.DynamicDataValue<DynamicBuilders.DynamicType>>
Returns a read-only Collection of all values in this map. Note that this collection may contain duplicate values.