Send feedback
Class GenericQuerySnapshot<QueryT> (3.28.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 3.28.0 keyboard_arrow_down
public abstract class GenericQuerySnapshot<QueryT> implements Iterable<QueryDocumentSnapshot>
Abstract. A GenericQuerySnapshot represents the results of a query that returns documents. It can
contain zero or more DocumentSnapshot objects.
Inheritance
Object >
GenericQuerySnapshot<QueryT>
Type Parameter
Name
Description
QueryT
Constructors
GenericQuerySnapshot(QueryT query, Timestamp readTime, List<QueryDocumentSnapshot> documents, List<DocumentChange> documentChanges)
protected GenericQuerySnapshot ( QueryT query , Timestamp readTime , List<QueryDocumentSnapshot> documents , List<DocumentChange> documentChanges )
Fields
query
protected final QueryT query
Field Value
Type
Description
QueryT
readTime
protected final Timestamp readTime
Field Value
Type
Description
com.google.cloud.Timestamp
Methods
<T>toObjects(Class<T> clazz)
public List<T> <T>toObjects ( Class<T> clazz )
Returns the contents of the documents in the QuerySnapshot, converted to the provided class, as
a list.
Parameter
Name
Description
clazz
Class <T >
The POJO type used to convert the documents in the list.
Returns
Type
Description
List <T >
equals(Object o)
public boolean equals ( Object o )
Tests for equality with this object.
Parameter
Name
Description
o
Object
is tested for equality with this object.
Returns
Type
Description
boolean
true
if equal, otherwise false
Overrides
getDocumentChanges()
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
Type
Description
List <DocumentChange >
The list of documents that changed since the last snapshot.
getDocuments()
public List<QueryDocumentSnapshot> getDocuments ()
Returns the documents in this QuerySnapshot as a List in order of the query.
getQuery()
Returns the query for the snapshot.
Returns
Type
Description
QueryT
The backing query that produced this snapshot.
getReadTime()
public Timestamp getReadTime ()
Returns the time at which this snapshot was read.
Returns
Type
Description
com.google.cloud.Timestamp
The read time of this snapshot.
hashCode()
Returns
Type
Description
int
Overrides
isEmpty()
Returns true if there are no documents in the QuerySnapshot.
iterator()
public Iterator<QueryDocumentSnapshot> iterator ()
size()
Returns the number of DocumentSnapshots in this snapshot.
Returns
Type
Description
int
toString()
Returns
Type
Description
String
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-19 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-19 UTC."],[],[]]