2525import com .google .api .core .ApiFuture ;
2626import com .google .api .core .SettableApiFuture ;
2727import com .google .api .gax .rpc .ApiStreamObserver ;
28- import com .google .cloud .firestore .DocumentChange .Type ;
2928import com .google .common .base .Preconditions ;
3029import com .google .firestore .v1beta1 .Cursor ;
3130import com .google .firestore .v1beta1 .Document ;
@@ -996,13 +995,10 @@ ApiFuture<QuerySnapshot> get(@Nullable ByteString transactionId) {
996995 stream (
997996 new QuerySnapshotObserver () {
998997 List <QueryDocumentSnapshot > documentSnapshots = new ArrayList <>();
999- List <DocumentChange > documentChanges = new ArrayList <>();
1000998
1001999 @ Override
10021000 public void onNext (QueryDocumentSnapshot documentSnapshot ) {
10031001 documentSnapshots .add (documentSnapshot );
1004- documentChanges .add (
1005- new DocumentChange (documentSnapshot , Type .ADDED , -1 , documentSnapshots .size () - 1 ));
10061002 }
10071003
10081004 @ Override
@@ -1013,8 +1009,7 @@ public void onError(Throwable throwable) {
10131009 @ Override
10141010 public void onCompleted () {
10151011 QuerySnapshot querySnapshot =
1016- new QuerySnapshot (
1017- Query .this , this .getReadTime (), documentSnapshots , documentChanges );
1012+ QuerySnapshot .withDocuments (Query .this , this .getReadTime (), documentSnapshots );
10181013 result .set (querySnapshot );
10191014 }
10201015 },
@@ -1071,15 +1066,21 @@ ResourcePath getResourcePath() {
10711066 return path ;
10721067 }
10731068
1069+ /**
1070+ * Returns true if this Query is equal to the provided object.
1071+ *
1072+ * @param obj The object to compare against.
1073+ * @return Whether this Query is equal to the provided object.
1074+ */
10741075 @ Override
1075- public boolean equals (Object o ) {
1076- if (this == o ) {
1076+ public boolean equals (Object obj ) {
1077+ if (this == obj ) {
10771078 return true ;
10781079 }
1079- if (o == null || getClass () != o .getClass ()) {
1080+ if (obj == null || getClass () != obj .getClass ()) {
10801081 return false ;
10811082 }
1082- Query query = (Query ) o ;
1083+ Query query = (Query ) obj ;
10831084 return Objects .equals (path , query .path )
10841085 && Objects .equals (firestore , query .firestore )
10851086 && Objects .equals (options , query .options );
0 commit comments