DynamicDataMap
public 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 methods |
|
|---|---|
final boolean |
<T extends DynamicBuilders.DynamicType> contains(Returns true if this map contains the specified |
final boolean |
<T extends DynamicBuilders.DynamicType> contains(Returns true if this map contains the specified |
boolean |
|
final Boolean |
Gets the boolean value mapped to |
final Color |
Gets the color value mapped to |
final Duration |
|
final Float |
Gets the float value mapped to |
final Instant |
|
final Integer |
Gets the integer value mapped to |
final String |
Gets the string value mapped to |
final @NonNull Set<@NonNull Map.Entry<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>, @NonNull DynamicDataBuilders.DynamicDataValue<@NonNull DynamicBuilders.DynamicType>>> |
Returns a read-only |
final @NonNull Set<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>> |
getKeys()Returns a read-only |
final int |
getSize()Returns the number of key/value pairs in the map. |
final @NonNull Collection<@NonNull DynamicDataBuilders.DynamicDataValue<@NonNull DynamicBuilders.DynamicType>> |
Returns a read-only |
int |
hashCode() |
final @NonNull DynamicDataMap |
plus(@NonNull DynamicDataMap rhs) |
@NonNull String |
toString() |
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 |
@NonNull DynamicDataKey<@NonNull T> key |
the key to check for. |
contains
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 |
get
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 |
get
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 |
get
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- |
get
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
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 |
get
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 |
get
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 |
getEntries
public final @NonNull Set<@NonNull Map.Entry<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>, @NonNull DynamicDataBuilders.DynamicDataValue<@NonNull DynamicBuilders.DynamicType>>> getEntries()
Returns a read-only Set of all key/value pairs in this map.
getKeys
public final @NonNull Set<@NonNull DynamicDataKey<@NonNull DynamicBuilders.DynamicType>> getKeys()
Returns a read-only Set of all keys in this map.
getValues
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.