public final class MutableDictionary extends Dictionary implements MutableDictionaryInterface
Constructor and Description |
---|
MutableDictionary()
Initialize a new empty Dictionary object.
|
MutableDictionary(Map<String,Object> data)
Creates a new MutableDictionary with content from the passed Map.
|
MutableDictionary(String json)
Creates a new MutableDictionary with content from the passed JSON string.
|
Modifier and Type | Method and Description |
---|---|
MutableArray |
getArray(String key)
Get a property's value as a Array, which is a mapping object of an array value.
|
MutableDictionary |
getDictionary(String key)
Get a property's value as a Dictionary, which is a mapping object of an dictionary value.
|
MutableDictionary |
remove(String key)
Removes the mapping for a key from this Dictionary
|
MutableDictionary |
setArray(String key,
Array value)
Set an Array object for the given key.
|
MutableDictionary |
setBlob(String key,
Blob value)
Set a Blob object for the given key.
|
MutableDictionary |
setBoolean(String key,
boolean value)
Set a boolean value for the given key.
|
MutableDictionary |
setData(Map<String,Object> data)
Populate a dictionary with content from a Map.
|
MutableDictionary |
setDate(String key,
Date value)
Set a Date object for the given key.
|
MutableDictionary |
setDictionary(String key,
Dictionary value)
Set a Dictionary object for the given key.
|
MutableDictionary |
setDouble(String key,
double value)
Set a double value for the given key.
|
MutableDictionary |
setFloat(String key,
float value)
Set a float value for the given key.
|
MutableDictionary |
setInt(String key,
int value)
Set an int value for the given key.
|
MutableDictionary |
setJSON(String json)
Populate a dictionary with content from a JSON string.
|
MutableDictionary |
setLong(String key,
long value)
Set a long value for the given key.
|
MutableDictionary |
setNumber(String key,
Number value)
Set a Number value for the given key.
|
MutableDictionary |
setString(String key,
String value)
Set a String value for the given key.
|
MutableDictionary |
setValue(String key,
Object value)
Set an object value by key.
|
String |
toJSON() |
contains, count, encodeTo, equals, getBlob, getBoolean, getDate, getDouble, getFloat, getInt, getKeys, getLong, getNumber, getString, getValue, hashCode, iterator, toMap, toMutable, toString
contains, count, getBlob, getBoolean, getDate, getDouble, getFloat, getInt, getKeys, getLong, getNumber, getString, getValue, toMap
forEach, spliterator
public MutableDictionary()
public MutableDictionary(@NonNull Map<String,Object> data)
data
- the dictionary content map.public MutableDictionary(@NonNull String json)
json
- the dictionary content as a JSON string.@NonNull public MutableDictionary setData(@NonNull Map<String,Object> data)
setData
in interface MutableDictionaryInterface
data
- the dictionary object.@NonNull public MutableDictionary setJSON(@NonNull String json)
setJSON
in interface MutableDictionaryInterface
json
- the dictionary object.@NonNull public MutableDictionary setValue(@NonNull String key, @Nullable Object value)
setValue
in interface MutableDictionaryInterface
key
- the key.value
- the object value.@NonNull public MutableDictionary setString(@NonNull String key, @Nullable String value)
setString
in interface MutableDictionaryInterface
key
- The keyvalue
- The String value.@NonNull public MutableDictionary setNumber(@NonNull String key, @Nullable Number value)
setNumber
in interface MutableDictionaryInterface
key
- The keyvalue
- The number value.@NonNull public MutableDictionary setInt(@NonNull String key, int value)
setInt
in interface MutableDictionaryInterface
key
- The keyvalue
- The int value.@NonNull public MutableDictionary setLong(@NonNull String key, long value)
setLong
in interface MutableDictionaryInterface
key
- The keyvalue
- The long value.@NonNull public MutableDictionary setFloat(@NonNull String key, float value)
setFloat
in interface MutableDictionaryInterface
key
- The keyvalue
- The float value.@NonNull public MutableDictionary setDouble(@NonNull String key, double value)
setDouble
in interface MutableDictionaryInterface
key
- The keyvalue
- The double value.@NonNull public MutableDictionary setBoolean(@NonNull String key, boolean value)
setBoolean
in interface MutableDictionaryInterface
key
- The keyvalue
- The boolean value.@NonNull public MutableDictionary setBlob(@NonNull String key, @NonNull Blob value)
setBlob
in interface MutableDictionaryInterface
key
- The keyvalue
- The Blob object.@NonNull public MutableDictionary setDate(@NonNull String key, @NonNull Date value)
setDate
in interface MutableDictionaryInterface
key
- The keyvalue
- The Date object.@NonNull public MutableDictionary setArray(@NonNull String key, @NonNull Array value)
setArray
in interface MutableDictionaryInterface
key
- The keyvalue
- The Array object.@NonNull public MutableDictionary setDictionary(@NonNull String key, @NonNull Dictionary value)
setDictionary
in interface MutableDictionaryInterface
key
- The keyvalue
- The Dictionary object.@NonNull public MutableDictionary remove(@NonNull String key)
remove
in interface MutableDictionaryInterface
key
- the key.@Nullable public MutableArray getArray(@NonNull String key)
getArray
in interface DictionaryInterface
getArray
in interface MutableDictionaryInterface
getArray
in class Dictionary
key
- the key.@Nullable public MutableDictionary getDictionary(@NonNull String key)
getDictionary
in interface DictionaryInterface
getDictionary
in interface MutableDictionaryInterface
getDictionary
in class Dictionary
key
- the key.@NonNull public String toJSON()
toJSON
in interface DictionaryInterface
toJSON
in class Dictionary