Class DocumentSnapshot
java.lang.Object
com.codename1.cloud.firebase.DocumentSnapshot
An immutable copy of one Firestore document as the server returned it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()Returns
static DocumentSnapshotBuilds a snapshot from a RESTDocumentobject.Reads one top-level field.Returns
getData()Returns
getId()Returns
getName()Returns
getPath()Returns
Returns
toString()Returns a string representation of the object.
-
Constructor Details
-
DocumentSnapshot
Creates a snapshot.
Parameters
-
name: the full resource name -
data: the decoded fields, or null when the document does not exist -
createTime: the server create time, may be null -
updateTime: the server update time, may be null
-
-
-
Method Details
-
fromJson
Builds a snapshot from a REST
Documentobject.Parameters
doc: the parsed JSON document
Returns
the snapshot
-
exists
public boolean exists()Returns
true when the document exists
-
getName
Returns
the full resource name
-
getId
Returns
the last path segment, the document ID
-
getPath
Returns
the path relative to the database root, such as
cities/SF -
getData
-
get
-
getUpdateTime
Returns
the RFC 3339 update time, or null
-
getCreateTime
Returns
the RFC 3339 create time, or null
-
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-