public class DynamicDataMap

Known direct subclasses
MutableDynamicDataMap

A mutable heterogeneous map of DynamicType keys to their corresponding values.


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 methods

final boolean

Returns true if this map contains the specified key and it is associated with the specified type T.

final boolean
<T extends DynamicBuilders.DynamicType> contains(
    @NonNull DynamicDataKey<@NonNull T> key,
    @NonNull Class<@NonNull T> type
)

Returns true if this map contains the specified key and it is associated with the specified type.

boolean
equals(Object other)
final Boolean

Gets the boolean value mapped to key.

final Color

Gets the color value mapped to key.

final Duration

Gets the Duration value mapped to key.

final Float

Gets the float value mapped to key.

final Instant

Gets the Instant value mapped to key.

final Integer

Gets the integer value mapped to key.

final String

Gets the string value mapped to key.

final @NonNull Set<@NonNull Map.Entry<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>, @NonNull DynamicDataBuilders.DynamicDataValue<@NonNull DynamicBuilders.DynamicType>>>

Returns a read-only Set of all key/value pairs in this map.

final @NonNull Set<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>>

Returns a read-only Set of all keys in this map.

final int

Returns the number of key/value pairs in the map.

final @NonNull Collection<@NonNull DynamicDataBuilders.DynamicDataValue<@NonNull DynamicBuilders.DynamicType>>

Returns a read-only Collection of all values in this map.

int
final @NonNull DynamicDataMap
@NonNull String

Public methods

contains

public final boolean <T extends DynamicBuilders.DynamicType> contains(
    @NonNull DynamicDataKey<@NonNull T> key
)

Returns true if this map contains the specified key and it is associated with the specified type T.

Parameters
<T extends DynamicBuilders.DynamicType>

the type to match the value's type against. Dynamic and raw types can be used interchangeably. For example DynamicInt32 and Int both return true if the associated value is of DynamicInt32 type.

@NonNull DynamicDataKey<@NonNull T> key

the key to check for.

contains

Added in 1.3.0-alpha08
public final boolean <T extends DynamicBuilders.DynamicType> contains(
    @NonNull DynamicDataKey<@NonNull T> key,
    @NonNull Class<@NonNull T> type
)

Returns true if this map contains the specified key and it is associated with the specified type.

Parameters
@NonNull DynamicDataKey<@NonNull T> key

the key to check for.

@NonNull Class<@NonNull T> type

the type to match the value's type against. Dynamic and raw types can be used interchangeably. For example DynamicInt32 and Int both return true if the associated value is of DynamicInt32 type.

equals

public boolean equals(Object other)

get

Added in 1.3.0-alpha08
public final Boolean get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicBool> key)

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 key.

get

Added in 1.3.0-alpha08
public final Color get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicColor> key)

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 key.

get

Added in 1.3.0-alpha08
public final Duration get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicDuration> key)

Gets the Duration value mapped to key. If there isn't any mapped value for key, returns null.

Throws
kotlin.IllegalStateException

if a non-Duration value is stored with the same name as key.

get

Added in 1.3.0-alpha08
public final Float get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicFloat> key)

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

Added in 1.3.0-alpha08
public final Instant get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicInstant> key)

Gets the Instant value mapped to key. If there isn't any mapped value for key, returns null.

Throws
kotlin.IllegalStateException

if a non-Instant value is stored with the same name as key.

get

Added in 1.3.0-alpha08
public final Integer get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicInt32> key)

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 key.

get

Added in 1.3.0-alpha08
public final String get(@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicString> key)

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 key.

getKeys

Added in 1.3.0-alpha08
public final @NonNull Set<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>> getKeys()

Returns a read-only Set of all keys in this map.

getSize

Added in 1.3.0-alpha08
public final int getSize()

Returns the number of key/value pairs in the map.

getValues

Added in 1.3.0-alpha08
public final @NonNull Collection<@NonNull DynamicDataBuilders.DynamicDataValue<@NonNull DynamicBuilders.DynamicType>> getValues()

Returns a read-only Collection of all values in this map. Note that this collection may contain duplicate values.

hashCode

public int hashCode()

plus

Added in 1.3.0-alpha08
public final @NonNull DynamicDataMap plus(@NonNull DynamicDataMap rhs)

toString

public @NonNull String toString()