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 |
set(String key,
Object value)
Set an object value by key.
|
protected void |
setC4Doc(com.couchbase.lite.CBLC4Doc c4doc) |
Map<String,Object> |
toMap()
Gets content of the current object as an Map.
|
getId, getSequence, isDeleted, toStringfleeceEncode, getData, iterator, setDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, iterator, 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 set(String key, Object value)
key - the key.value - the object 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)
throws CouchbaseLiteException
setC4Doc in class ReadOnlyDocumentCouchbaseLiteException