public final class Document extends ReadOnlyDocument
| Constructor and Description |
|---|
Document()
Creates a new Document object with a new random UUID.
|
Document(Map<String,Object> dictionary)
Initializes a new CBLDocument object with a new random UUID and the dictionary as the content.
|
Document(String id)
Creates a new Document object with the given ID.
|
Document(String id,
Map<String,Object> dictionary)
Initializes a new Document object with a given ID and the dictionary as the 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.
|
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.
|
Document |
remove(String key)
Removes the mapping for a key from this Dictionary
|
Document |
set(Map<String,Object> dictionary)
Set a dictionary as a content.
|
Document |
setArray(String key,
Array value) |
Document |
setBlob(String key,
Blob value) |
Document |
setBoolean(String key,
boolean value) |
protected void |
setC4Doc(com.couchbase.lite.CBLC4Doc c4doc) |
Document |
setDate(String key,
Date value) |
Document |
setDictionary(String key,
Dictionary value) |
Document |
setDouble(String key,
double value) |
Document |
setFloat(String key,
float value) |
Document |
setInt(String key,
int value) |
Document |
setLong(String key,
long value) |
Document |
setNumber(String key,
Number value) |
Document |
setObject(String key,
Object value)
Set an object value by key.
|
Document |
setString(String key,
String value) |
Map<String,Object> |
toMap()
Gets content of the current object as an Map.
|
finalize, getId, getSequence, isDeleted, toStringfleeceEncode, getData, iterator, setDataclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Document()
public Document(String id)
id - the document ID.public Document(Map<String,Object> dictionary)
dictionary - the Map objectpublic Document(String id, Map<String,Object> dictionary)
id - the document ID.dictionary - the Map objectpublic Document set(Map<String,Object> dictionary)
dictionary - the dictionary object.public Document setObject(String key, Object value)
key - the key.value - the object value.public Document setDictionary(String key, Dictionary value)
public Document 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 List<String> getKeys()
getKeys 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 keyprotected void setC4Doc(com.couchbase.lite.CBLC4Doc c4doc)
setC4Doc in class ReadOnlyDocument