Class PipelineResult (3.35.1)

public final class 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.

Inheritance

Object > PipelineResult

Methods

<T>get(FieldPath fieldPath, Class<T> valueType)

public T <T>get(FieldPath fieldPath, Class<T> valueType)

Returns the value at the field, converted to a POJO, or null if the field or result doesn't exist.

Parameters
Name Description
fieldPath FieldPath

The path to the field

valueType Class<T>

The Java class to convert the field value to.

Returns
Type Description
T

The value at the given field or null.

<T>get(String field, Class<T> valueType)

public T <T>get(String field, Class<T> valueType)

Returns the value at the field, converted to a POJO, or null if the field or result doesn't exist.

Parameters
Name Description
field String

The path to the field

valueType Class<T>

The Java class to convert the field value to.

Returns
Type Description
T

The value at the given field or null.

contains(FieldPath fieldPath)

public boolean contains(FieldPath fieldPath)

Returns whether or not the field exists in the document. Returns false if the result does not exist.

Parameter
Name Description
fieldPath FieldPath

the path to the field.

Returns
Type Description
boolean

true iff the field exists.

contains(String field)

public boolean contains(String field)

Returns whether or not the field exists in the document. Returns false if the result does not exist.

Parameter
Name Description
field String

the path to the field.

Returns
Type Description
boolean

true iff the field exists.

equals(Object obj)

public boolean equals(Object obj)

Returns true if the document's data and path in this DocumentSnapshot equals the provided snapshot.

Parameter
Name Description
obj Object

The object to compare against.

Returns
Type Description
boolean

Whether this DocumentSnapshot is equal to the provided object.

Overrides

exists()

public boolean exists()

Returns whether or not the field exists in the document. Returns false if the document does not exist.

Returns
Type Description
boolean

whether the document existed in this snapshot.

get(FieldPath fieldPath)

public Object get(FieldPath fieldPath)

Returns the value at the field or null if the field doesn't exist.

Parameter
Name Description
fieldPath FieldPath

The path to the field.

Returns
Type Description
Object

The value at the given field or null.

get(String field)

public Object get(String field)

Returns the value at the field or null if the field doesn't exist.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
Object

The value at the given field or null.

getBlob(String field)

public Blob getBlob(String field)

Returns the value of the field as a Blob.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
Blob

The value of the field.

getBoolean(String field)

public Boolean getBoolean(String field)

Returns the value of the field as a boolean.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
Boolean

The value of the field.

getCreateTime()

public Timestamp getCreateTime()

Returns the time at which this document was created. Returns null if this result is not corresponding to a Firestore document.

Returns
Type Description
com.google.cloud.Timestamp

getData()

public Map<String,Object> 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
Type Description
Map<String,Object>

The fields of the document as a Map or null if the result doesn't exist.

getDate(String field)

public Date getDate(String field)

Returns the value of the field as a Date.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
Date

The value of the field.

getDouble(String field)

public Double getDouble(String field)

Returns the value of the field as a double.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
Double

The value of the field.

getExecutionTime()

public Timestamp getExecutionTime()

Returns the time at which the pipeline producing this result is executed.

Returns
Type Description
com.google.cloud.Timestamp

getGeoPoint(String field)

public GeoPoint getGeoPoint(String field)

Returns the value of the field as a GeoPoint.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
GeoPoint

The value of the field.

getId()

public String getId()

Returns the ID of the document represented by this result. Returns null if this result is not corresponding to a Firestore document.

Returns
Type Description
String

getLong(String field)

public Long getLong(String field)

Returns the value of the field as a long.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
Long

The value of the field.

getReference()

public DocumentReference getReference()

Gets the reference to the document.

Returns
Type Description
DocumentReference

The reference to the document.

getString(String field)

public String getString(String field)

Returns the value of the field as a String.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
String

The value of the field.

getTimestamp(String field)

public Timestamp getTimestamp(String field)

Returns the value of the field as a Timestamp.

Parameter
Name Description
field String

The path to the field.

Returns
Type Description
com.google.cloud.Timestamp

The value of the field.

getUpdateTime()

public Timestamp getUpdateTime()

Returns the time at which this document was last updated. Returns null if this result is not corresponding to a Firestore document.

Returns
Type Description
com.google.cloud.Timestamp

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides