QuerySnapshot | Doclava
public class

QuerySnapshot

extends Object
implements Iterable<QueryDocumentSnapshot>
java.lang.Object
   ↳ com.google.firebase.firestore.QuerySnapshot

Class Overview

A QuerySnapshot contains the results of a query. It can contain zero or more DocumentSnapshot objects.

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.

Summary

Public Methods
boolean equals(Object obj)
List<DocumentChange> getDocumentChanges()
Returns the list of documents that changed since the last snapshot.
List<DocumentSnapshot> getDocuments()
Returns the documents in this QuerySnapshot as a List in order of the query.
SnapshotMetadata getMetadata()
Query getQuery()
int hashCode()
boolean isEmpty()
Returns true if there are no documents in the QuerySnapshot.
Iterator<QueryDocumentSnapshot> iterator()
int size()
Returns the number of documents in the QuerySnapshot.
<T> List<T> toObjects(Class<T> clazz)
Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as a list.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Iterable

Public Methods

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public List<DocumentChange> getDocumentChanges ()

Returns the list of documents that changed since the last snapshot. If it's the first snapshot all documents will be in the list as added changes.

Returns
List<DocumentChange> The list of documents that changed since the last snapshot.

public List<DocumentSnapshot> getDocuments ()

Returns the documents in this QuerySnapshot as a List in order of the query.

Returns
List<DocumentSnapshot> The list of documents.

public SnapshotMetadata getMetadata ()

Returns
SnapshotMetadata The metadata for this document snapshot.

public Query getQuery ()

Returns
Query

public int hashCode ()

Returns
int

public boolean isEmpty ()

Returns true if there are no documents in the QuerySnapshot.

Returns
boolean

public Iterator<QueryDocumentSnapshot> iterator ()

Returns
Iterator<QueryDocumentSnapshot>

public int size ()

Returns the number of documents in the QuerySnapshot.

Returns
int

public List<T> toObjects (Class<T> clazz)

Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as a list.

Parameters
clazz Class: The POJO type used to convert the documents in the list.
Returns
List<T>