33
33
import com .google .firebase .firestore .model .SnapshotVersion ;
34
34
import com .google .firebase .firestore .util .BackgroundQueue ;
35
35
import com .google .firebase .firestore .util .Executors ;
36
- import com .google .firebase .firestore .util .Function ;
36
+ import com .google .firebase .firestore .util .Predicate ;
37
37
import com .google .protobuf .InvalidProtocolBufferException ;
38
38
import com .google .protobuf .MessageLite ;
39
39
import java .util .ArrayList ;
44
44
import java .util .Map ;
45
45
import java .util .Set ;
46
46
import java .util .concurrent .Executor ;
47
+
47
48
import javax .annotation .Nonnull ;
48
49
import javax .annotation .Nullable ;
49
50
@@ -182,7 +183,7 @@ private Map<DocumentKey, MutableDocument> getAll(
182
183
List <ResourcePath > collections ,
183
184
IndexOffset offset ,
184
185
int count ,
185
- @ Nullable Function <MutableDocument , Boolean > filter ,
186
+ @ Nullable Predicate <MutableDocument > filter ,
186
187
@ Nullable QueryContext context ) {
187
188
Timestamp readTime = offset .getReadTime ().getTimestamp ();
188
189
DocumentKey documentKey = offset .getDocumentKey ();
@@ -234,15 +235,15 @@ private Map<DocumentKey, MutableDocument> getAll(
234
235
List <ResourcePath > collections ,
235
236
IndexOffset offset ,
236
237
int count ,
237
- @ Nullable Function <MutableDocument , Boolean > filter ) {
238
+ @ Nullable Predicate <MutableDocument > filter ) {
238
239
return getAll (collections , offset , count , filter , /*context*/ null );
239
240
}
240
241
241
242
private void processRowInBackground (
242
243
BackgroundQueue backgroundQueue ,
243
244
Map <DocumentKey , MutableDocument > results ,
244
245
Cursor row ,
245
- @ Nullable Function <MutableDocument , Boolean > filter ) {
246
+ @ Nullable Predicate <MutableDocument > filter ) {
246
247
byte [] rawDocument = row .getBlob (0 );
247
248
int readTimeSeconds = row .getInt (1 );
248
249
int readTimeNanos = row .getInt (2 );
@@ -254,7 +255,7 @@ private void processRowInBackground(
254
255
() -> {
255
256
MutableDocument document =
256
257
decodeMaybeDocument (rawDocument , readTimeSeconds , readTimeNanos );
257
- if (filter == null || filter .apply (document )) {
258
+ if (filter == null || filter .test (document )) {
258
259
synchronized (results ) {
259
260
results .put (document .getKey (), document );
260
261
}
0 commit comments