Class AggregateQuery (3.14.4)

public class AggregateQuery

A query that calculates aggregations over an underlying query.

Inheritance

Object > AggregateQuery

Static Methods

fromProto(Firestore firestore, RunAggregationQueryRequest proto)

public static AggregateQuery fromProto(Firestore firestore, RunAggregationQueryRequest proto)

Returns an AggregateQuery instance that can be used to execute the provided RunAggregationQueryRequest.

Only RunAggregationQueryRequests that pertain to the same project as the Firestore instance can be deserialized.

Parameters
NameDescription
firestoreFirestore

a Firestore instance to apply the query to.

protoRunAggregationQueryRequest

the serialized RunAggregationQueryRequest.

Returns
TypeDescription
AggregateQuery

a AggregateQuery instance that can be used to execute the RunAggregationQueryRequest.

Methods

equals(Object object)

public boolean equals(Object object)

Compares this object with the given object for equality.

This object is considered "equal" to the other object if and only if all of the following conditions are satisfied:

  1. object is a non-null instance of AggregateQuery.
  2. object performs the same aggregations as this AggregateQuery.
  3. The underlying Query of object compares equal to that of this object.
Parameter
NameDescription
objectObject

The object to compare to this object for equality.

Returns
TypeDescription
boolean

true if this object is "equal" to the given object, as defined above, or false otherwise.

Overrides

get()

public ApiFuture<AggregateQuerySnapshot> get()

Executes this query.

Returns
TypeDescription
ApiFuture<AggregateQuerySnapshot>

An ApiFuture that will be resolved with the results of the query.

getQuery()

public Query getQuery()

Returns the query whose aggregations will be calculated by this object.

Returns
TypeDescription
Query

hashCode()

public int hashCode()

Calculates and returns the hash code for this object.

Returns
TypeDescription
int

the hash code for this object.

Overrides

toProto()

public RunAggregationQueryRequest toProto()

Returns the RunAggregationQueryRequest that this AggregateQuery instance represents. The request contain the serialized form of all aggregations and Query constraints.

Returns
TypeDescription
RunAggregationQueryRequest

the serialized RunAggregationQueryRequest