public class Dictionary extends ReadOnlyDictionary
| Constructor and Description |
|---|
Dictionary()
Initialize a new empty Dictionary object.
|
Dictionary(Map<String,Object> dictionary)
Initializes a new CBLDictionary object with dictionary content.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String key)
Tests whether a property exists or not.
|
int |
count()
Gets a number of the entries in the dictionary.
|
void |
fleeceEncode(FLEncoder encoder,
Database database) |
Array |
getArray(String key)
Get a property's value as a Array, which is a mapping object of an array value.
|
Blob |
getBlob(String key)
Gets a property's value as a Blob.
|
boolean |
getBoolean(String key)
Gets a property's value as a boolean.
|
Date |
getDate(String key)
Gets a property's value as a Date.
|
Dictionary |
getDictionary(String key)
Get a property's value as a Dictionary, which is a mapping object of an dictionary value.
|
double |
getDouble(String key)
Gets a property's value as an double.
|
float |
getFloat(String key)
Gets a property's value as an float.
|
int |
getInt(String key)
Gets a property's value as an int.
|
List<String> |
getKeys() |
long |
getLong(String key)
Gets a property's value as an long.
|
Number |
getNumber(String key)
Gets a property's value as a Number.
|
Object |
getObject(String key)
Gets a property's value as an object.
|
String |
getString(String key)
Gets a property's value as a String.
|
Iterator<String> |
iterator() |
Dictionary |
remove(String key)
Removes the mapping for a key from this Dictionary
|
Dictionary |
set(Map<String,Object> dictionary)
Set a dictionary as a content.
|
Dictionary |
set(String key,
Object value)
Set an object value by key.
|
Map<String,Object> |
toMap()
Gets content of the current object as an Map.
|
getData, setDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic Dictionary()
public Dictionary(Map<String,Object> dictionary)
dictionary - the dictionary object.public Dictionary set(Map<String,Object> dictionary)
dictionary - the dictionary object.public List<String> getKeys()
getKeys in class ReadOnlyDictionarypublic Dictionary set(String key, Object value)
key - the key.value - the object value.public Dictionary remove(String key)
key - the key.public Array getArray(String key)
getArray in class ReadOnlyDictionarykey - the key.public Dictionary getDictionary(String key)
getDictionary in class ReadOnlyDictionarykey - the key.public int count()
count in class ReadOnlyDictionarypublic Object getObject(String key)
getObject in class ReadOnlyDictionarykey - the key.public String getString(String key)
getString in class ReadOnlyDictionarykey - the keypublic Number getNumber(String key)
getNumber in class ReadOnlyDictionarykey - the keypublic int getInt(String key)
getInt in class ReadOnlyDictionarykey - the keypublic long getLong(String key)
getLong in class ReadOnlyDictionarykey - the keypublic float getFloat(String key)
getFloat in class ReadOnlyDictionarykey - the keypublic double getDouble(String key)
getDouble in class ReadOnlyDictionarykey - the keypublic boolean getBoolean(String key)
getBoolean in class ReadOnlyDictionarykey - the keypublic Blob getBlob(String key)
getBlob in class ReadOnlyDictionarykey - the keypublic Date getDate(String key)
getDate in class ReadOnlyDictionarykey - the keypublic Map<String,Object> toMap()
toMap in class ReadOnlyDictionarypublic boolean contains(String key)
contains in class ReadOnlyDictionarykey - the keypublic Iterator<String> iterator()
iterator in class ReadOnlyDictionarypublic void fleeceEncode(FLEncoder encoder,
Database database)
throws CouchbaseLiteException
fleeceEncode in class ReadOnlyDictionaryCouchbaseLiteException