Constructor and Description |
---|
MutableDocument()
Creates a new Document object with a new random UUID.
|
MutableDocument(Map<String,Object> data)
Initializes a new CBLDocument object with a new random UUID and the dictionary as the content.
|
MutableDocument(String id)
Creates a new Document object with the given ID.
|
MutableDocument(String id,
Map<String,Object> data)
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) |
int |
count() |
MutableArray |
getArray(String key)
Get a property's value as a Array, which is a mapping object of an array value.
|
Blob |
getBlob(String key) |
boolean |
getBoolean(String key) |
Date |
getDate(String key) |
MutableDictionary |
getDictionary(String key)
Get a property's value as a Dictionary, which is a mapping object of an dictionary value.
|
double |
getDouble(String key) |
float |
getFloat(String key) |
int |
getInt(String key) |
List<String> |
getKeys() |
long |
getLong(String key) |
Number |
getNumber(String key) |
String |
getString(String key) |
Object |
getValue(String key) |
boolean |
isDeleted()
Is the document deleted?
|
MutableDocument |
remove(String key)
Removes the mapping for a key from this Dictionary
|
MutableDocument |
setArray(String key,
Array value)
Set an Array value for the given key
|
MutableDocument |
setBlob(String key,
Blob value)
Set a Blob value for the given key
|
MutableDocument |
setBoolean(String key,
boolean value)
Set a boolean value for the given key
|
MutableDocument |
setData(Map<String,Object> data)
Set a dictionary as a content.
|
MutableDocument |
setDate(String key,
Date value)
Set a Date value for the given key
|
MutableDocument |
setDictionary(String key,
Dictionary value)
Set a Dictionary value for the given key
|
MutableDocument |
setDouble(String key,
double value)
Set a double value for the given key
|
MutableDocument |
setFloat(String key,
float value)
Set a float value for the given key
|
MutableDocument |
setInt(String key,
int value)
Set a integer value for the given key
|
MutableDocument |
setLong(String key,
long value)
Set a long value for the given key
|
MutableDocument |
setNumber(String key,
Number value)
Set a Number value for the given key
|
MutableDocument |
setString(String key,
String value)
Set a String value for the given key
|
MutableDocument |
setValue(String key,
Object value)
Set an object value by key.
|
Map<String,Object> |
toMap() |
MutableDocument |
toMutable()
Returns the copy of this MutableDocument object.
|
contains, count, equals, getBlob, getBoolean, getDate, getDouble, getFloat, getId, getInt, getKeys, getLong, getNumber, getSequence, getString, getValue, hashCode, iterator, toMap
getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public MutableDocument()
public MutableDocument(String id)
id
- the document ID.public MutableDocument(Map<String,Object> data)
data
- the Map objectpublic MutableDocument(String id, Map<String,Object> data)
id
- the document ID.data
- the Map objectpublic MutableDocument toMutable()
public boolean isDeleted()
public MutableDocument setData(Map<String,Object> data)
data
- the dictionary object.public MutableDocument setValue(String key, Object value)
key
- the key.value
- the Object value.public MutableDocument setString(String key, String value)
key
- the key.key
- the String value.public MutableDocument setNumber(String key, Number value)
key
- the key.key
- the Number value.public MutableDocument setInt(String key, int value)
key
- the key.key
- the integer value.public MutableDocument setLong(String key, long value)
key
- the key.key
- the long value.public MutableDocument setFloat(String key, float value)
key
- the key.key
- the float value.public MutableDocument setDouble(String key, double value)
key
- the key.key
- the double value.public MutableDocument setBoolean(String key, boolean value)
key
- the key.key
- the boolean value.public MutableDocument setBlob(String key, Blob value)
key
- the key.key
- the Blob value.public MutableDocument setDate(String key, Date value)
key
- the key.key
- the Date value.public MutableDocument setArray(String key, Array value)
key
- the key.key
- the Array value.public MutableDocument setDictionary(String key, Dictionary value)
key
- the key.key
- the Dictionary value.public MutableDocument remove(String key)
key
- the key.public MutableArray getArray(String key)
public MutableDictionary getDictionary(String key)
getDictionary
in class Document
key
- the key.public int count()
public int getInt(String key)
public long getLong(String key)
public float getFloat(String key)
public double getDouble(String key)
public boolean getBoolean(String key)
public boolean contains(String key)