Package com.google.cloud.firestore
Class PipelineResult
java.lang.Object
com.google.cloud.firestore.PipelineResult
A PipelineResult contains data read from a Firestore Pipeline. The data can be extracted with the
getData() or get(String) methods.
If the PipelineResult represents a non-document result, getReference() will return a null value.
Subclassing Note: Firestore classes are not meant to be subclassed except for use in test mocks. Subclassing is not supported in production code and new SDK releases may break code that does so.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether or not the field exists in the document.booleanReturns whether or not the field exists in the document.booleanReturns true if the document's data and path in this DocumentSnapshot equals the provided snapshot.booleanexists()Returns whether or not the field exists in the document.Returns the value at the field or null if the field doesn't exist.<T> TReturns the value at the field, converted to a POJO, or null if the field or result doesn't exist.Returns the value at the field or null if the field doesn't exist.<T> TReturns the value at the field, converted to a POJO, or null if the field or result doesn't exist.Returns the value of the field as a Blob.getBoolean(String field) Returns the value of the field as a boolean.com.google.cloud.TimestampReturns the time at which this document was created.getData()Returns the fields of the result as a Map or null if the result doesn't exist.Returns the value of the field as a Date.Returns the value of the field as a double.com.google.cloud.TimestampReturns the time at which the pipeline producing this result is executed.getGeoPoint(String field) Returns the value of the field as a GeoPoint.getId()Returns the ID of the document represented by this result.Returns the value of the field as a long.Gets the reference to the document.Returns the value of the field as a String.com.google.cloud.TimestampgetTimestamp(String field) Returns the value of the field as aTimestamp.com.google.cloud.TimestampReturns the time at which this document was last updated.inthashCode()toString()
-
Method Details
-
getId
Returns the ID of the document represented by this result. Returns null if this result is not corresponding to a Firestore document. -
getExecutionTime
Returns the time at which the pipeline producing this result is executed. -
getUpdateTime
Returns the time at which this document was last updated. Returns null if this result is not corresponding to a Firestore document. -
getCreateTime
Returns the time at which this document was created. Returns null if this result is not corresponding to a Firestore document. -
exists
@BetaApi public boolean exists()Returns whether or not the field exists in the document. Returns false if the document does not exist.- Returns:
- whether the document existed in this snapshot.
-
getData
Returns the fields of the result as a Map or null if the result doesn't exist. Field values will be converted to their native Java representation.- Returns:
- The fields of the document as a Map or null if the result doesn't exist.
-
contains
Returns whether or not the field exists in the document. Returns false if the result does not exist.- Parameters:
field- the path to the field.- Returns:
- true iff the field exists.
-
contains
Returns whether or not the field exists in the document. Returns false if the result does not exist.- Parameters:
fieldPath- the path to the field.- Returns:
- true iff the field exists.
-
get
Returns the value at the field or null if the field doesn't exist.- Parameters:
field- The path to the field.- Returns:
- The value at the given field or null.
-
get
Returns the value at the field, converted to a POJO, or null if the field or result doesn't exist.- Parameters:
field- The path to the fieldvalueType- The Java class to convert the field value to.- Returns:
- The value at the given field or null.
-
get
Returns the value at the field or null if the field doesn't exist.- Parameters:
fieldPath- The path to the field.- Returns:
- The value at the given field or null.
-
get
Returns the value at the field, converted to a POJO, or null if the field or result doesn't exist.- Parameters:
fieldPath- The path to the fieldvalueType- The Java class to convert the field value to.- Returns:
- The value at the given field or null.
-
getBoolean
Returns the value of the field as a boolean.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a Boolean.
-
getDouble
Returns the value of the field as a double.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a Number.
-
getString
Returns the value of the field as a String.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a String.
-
getLong
Returns the value of the field as a long.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a Number.
-
getDate
Returns the value of the field as a Date.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a Date.
-
getTimestamp
Returns the value of the field as aTimestamp.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a Date.
-
getBlob
Returns the value of the field as a Blob.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a Blob.
-
getGeoPoint
Returns the value of the field as a GeoPoint.- Parameters:
field- The path to the field.- Returns:
- The value of the field.
- Throws:
RuntimeException- if the value is not a GeoPoint.
-
getReference
Gets the reference to the document.- Returns:
- The reference to the document.
-
equals
Returns true if the document's data and path in this DocumentSnapshot equals the provided snapshot. -
hashCode
public int hashCode() -
toString
-