public class Document extends Object implements DictionaryInterface, Iterable<String>
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.
|
boolean |
equals(Object o) |
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
a 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.
|
String |
getId()
return the document's ID.
|
int |
getInt(String key)
Gets a property's value as an int.
|
List<String> |
getKeys()
Get an List containing all keys, or an empty List if the document has no properties.
|
long |
getLong(String key)
Gets a property's value as an long.
|
Number |
getNumber(String key)
Gets a property's value as a Number.
|
String |
getRevisionID()
Get the document's revision id.
|
long |
getSequence()
Return the sequence number of the document in the database.
|
String |
getString(String key)
Gets a property's value as a String.
|
Object |
getValue(String key)
Gets a property's value as an object.
|
int |
hashCode() |
Iterator<String> |
iterator()
Gets an iterator over the keys of the document's properties
|
String |
toJSON() |
Map<String,Object> |
toMap()
Gets content of the current object as an Map.
|
MutableDocument |
toMutable()
Return a mutable copy of the document
|
String |
toString() |
forEach, spliterator
@NonNull public String getId()
@Nullable public String getRevisionID()
public long getSequence()
@NonNull public MutableDocument toMutable()
public int count()
count
in interface DictionaryInterface
@NonNull public List<String> getKeys()
getKeys
in interface DictionaryInterface
@Nullable public Object getValue(@NonNull String key)
getValue
in interface DictionaryInterface
key
- the key.@Nullable public String getString(@NonNull String key)
getString
in interface DictionaryInterface
key
- the key@Nullable public Number getNumber(@NonNull String key)
getNumber
in interface DictionaryInterface
key
- the keypublic int getInt(@NonNull String key)
getInt
in interface DictionaryInterface
key
- the keypublic long getLong(@NonNull String key)
getLong
in interface DictionaryInterface
key
- the keypublic float getFloat(@NonNull String key)
getFloat
in interface DictionaryInterface
key
- the keypublic double getDouble(@NonNull String key)
getDouble
in interface DictionaryInterface
key
- the keypublic boolean getBoolean(@NonNull String key)
getBoolean
in interface DictionaryInterface
key
- the key@Nullable public Blob getBlob(@NonNull String key)
getBlob
in interface DictionaryInterface
key
- the key@Nullable public Date getDate(@NonNull String key)
getDate
in interface DictionaryInterface
key
- the key@Nullable public Array getArray(@NonNull String key)
getArray
in interface DictionaryInterface
key
- the key@Nullable public Dictionary getDictionary(@NonNull String key)
getDictionary
in interface DictionaryInterface
key
- the key@NonNull public Map<String,Object> toMap()
toMap
in interface DictionaryInterface
@Nullable public String toJSON()
toJSON
in interface DictionaryInterface
public boolean contains(@NonNull String key)
contains
in interface DictionaryInterface
key
- the key@NonNull public Iterator<String> iterator()