public abstract class QuerySnapshot extends Object implements Iterable<QueryDocumentSnapshot>
Modifier | Constructor and Description |
---|---|
protected |
QuerySnapshot(Query query,
com.google.cloud.Timestamp readTime) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
equals(Object obj)
Returns true if the document data in this QuerySnapshot equals the provided snapshot.
|
abstract List<DocumentChange> |
getDocumentChanges()
Returns the list of documents that changed since the last snapshot.
|
abstract List<QueryDocumentSnapshot> |
getDocuments()
Returns the documents in this QuerySnapshot as a List in order of the query.
|
Query |
getQuery()
Returns the query for the snapshot.
|
com.google.cloud.Timestamp |
getReadTime()
Returns the time at which this snapshot was read.
|
abstract int |
hashCode() |
boolean |
isEmpty()
Returns true if there are no documents in the QuerySnapshot.
|
Iterator<QueryDocumentSnapshot> |
iterator() |
abstract 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.
|
static QuerySnapshot |
withChanges(Query query,
com.google.cloud.Timestamp readTime,
com.google.cloud.firestore.DocumentSet documentSet,
List<DocumentChange> documentChanges)
Creates a new QuerySnapshot representing a snapshot of a Query with changed documents.
|
static QuerySnapshot |
withDocuments(Query query,
com.google.cloud.Timestamp readTime,
List<QueryDocumentSnapshot> documents)
Creates a new QuerySnapshot representing the results of a Query with added documents.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected QuerySnapshot(Query query, com.google.cloud.Timestamp readTime)
public static QuerySnapshot withDocuments(Query query, com.google.cloud.Timestamp readTime, List<QueryDocumentSnapshot> documents)
public static QuerySnapshot withChanges(Query query, com.google.cloud.Timestamp readTime, com.google.cloud.firestore.DocumentSet documentSet, List<DocumentChange> documentChanges)
@Nonnull public Query getQuery()
@Nonnull public com.google.cloud.Timestamp getReadTime()
@Nonnull public abstract List<QueryDocumentSnapshot> getDocuments()
@Nonnull public abstract List<DocumentChange> getDocumentChanges()
public boolean isEmpty()
public abstract int size()
@Nonnull public Iterator<QueryDocumentSnapshot> iterator()
iterator
in interface Iterable<QueryDocumentSnapshot>
@Nonnull public <T> List<T> toObjects(@Nonnull Class<T> clazz)
clazz
- The POJO type used to convert the documents in the list.public abstract boolean equals(Object obj)
Copyright © 2023 Google LLC. All rights reserved.