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 |
setArray(String key,
Array value) |
Dictionary |
setBlob(String key,
Blob value) |
Dictionary |
setBoolean(String key,
boolean value) |
Dictionary |
setDate(String key,
Date value) |
Dictionary |
setDictionary(String key,
Dictionary value) |
Dictionary |
setDouble(String key,
double value) |
Dictionary |
setFloat(String key,
float value) |
Dictionary |
setInt(String key,
int value) |
Dictionary |
setLong(String key,
long value) |
Dictionary |
setNumber(String key,
Number value) |
Dictionary |
setObject(String key,
Object value)
Set an object value by key.
|
Dictionary |
setString(String key,
String value) |
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 setObject(String key, Object value)
key - the key.value - the object value.public Dictionary setString(String key, String value)
public Dictionary setNumber(String key, Number value)
public Dictionary setInt(String key, int value)
public Dictionary setLong(String key, long value)
public Dictionary setFloat(String key, float value)
public Dictionary setDouble(String key, double value)
public Dictionary setBoolean(String key, boolean value)
public Dictionary setBlob(String key, Blob value)
public Dictionary setDate(String key, Date value)
public Dictionary setArray(String key, Array value)
public Dictionary setDictionary(String key, Dictionary 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 interface Iterable<String>iterator in class ReadOnlyDictionarypublic void fleeceEncode(FLEncoder encoder,
Database database)
fleeceEncode in class ReadOnlyDictionary