public final class MutableDocument extends Document implements MutableDictionaryInterface
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 |
---|---|
MutableArray |
getArray(String key)
Get a property's value as a Array, which is a mapping object of an array value.
|
MutableDictionary |
getDictionary(String key)
Get a property's value as a Dictionary, which is a mapping object of an dictionary value.
|
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.
|
MutableDocument |
toMutable()
Returns the copy of this MutableDocument object.
|
contains, count, equals, getBlob, getBoolean, getDate, getDouble, getFloat, getId, getInt, getKeys, getLong, getNumber, getRevisionID, getSequence, getString, getValue, hashCode, iterator, toMap, toString
contains, count, getBlob, getBoolean, getDate, getDouble, getFloat, getInt, getKeys, getLong, getNumber, getString, getValue, toMap
forEach, spliterator
public MutableDocument()
public MutableDocument(@Nullable String id)
id
- the document ID.public MutableDocument(@NonNull Map<String,Object> data)
data
- the Map objectpublic MutableDocument(@Nullable String id, Map<String,Object> data)
id
- the document ID.data
- the Map object@NonNull public MutableDocument toMutable()
@NonNull public MutableDocument setData(Map<String,Object> data)
setData
in interface MutableDictionaryInterface
data
- the dictionary object.@NonNull public MutableDocument setValue(@NonNull String key, Object value)
setValue
in interface MutableDictionaryInterface
key
- the key.value
- the Object value.@NonNull public MutableDocument setString(@NonNull String key, String value)
setString
in interface MutableDictionaryInterface
key
- the key.value
- the String value.@NonNull public MutableDocument setNumber(@NonNull String key, Number value)
setNumber
in interface MutableDictionaryInterface
key
- the key.value
- the Number value.@NonNull public MutableDocument setInt(@NonNull String key, int value)
setInt
in interface MutableDictionaryInterface
key
- the key.value
- the integer value.@NonNull public MutableDocument setLong(@NonNull String key, long value)
setLong
in interface MutableDictionaryInterface
key
- the key.value
- the long value.@NonNull public MutableDocument setFloat(@NonNull String key, float value)
setFloat
in interface MutableDictionaryInterface
key
- the key.value
- the float value.@NonNull public MutableDocument setDouble(@NonNull String key, double value)
setDouble
in interface MutableDictionaryInterface
key
- the key.value
- the double value.@NonNull public MutableDocument setBoolean(@NonNull String key, boolean value)
setBoolean
in interface MutableDictionaryInterface
key
- the key.value
- the boolean value.@NonNull public MutableDocument setBlob(@NonNull String key, Blob value)
setBlob
in interface MutableDictionaryInterface
key
- the key.value
- the Blob value.@NonNull public MutableDocument setDate(@NonNull String key, Date value)
setDate
in interface MutableDictionaryInterface
key
- the key.value
- the Date value.@NonNull public MutableDocument setArray(@NonNull String key, Array value)
setArray
in interface MutableDictionaryInterface
key
- the key.value
- the Array value.@NonNull public MutableDocument setDictionary(@NonNull String key, Dictionary value)
setDictionary
in interface MutableDictionaryInterface
key
- the key.value
- the Dictionary value.@NonNull public MutableDocument remove(@NonNull String key)
remove
in interface MutableDictionaryInterface
key
- the key.public MutableArray getArray(@NonNull String key)
getArray
in interface DictionaryInterface
getArray
in interface MutableDictionaryInterface
getArray
in class Document
key
- the key.public MutableDictionary getDictionary(@NonNull String key)
getDictionary
in interface DictionaryInterface
getDictionary
in interface MutableDictionaryInterface
getDictionary
in class Document
key
- the key.