3333import com .google .firebase .firestore .model .SnapshotVersion ;
3434import com .google .firebase .firestore .util .BackgroundQueue ;
3535import com .google .firebase .firestore .util .Executors ;
36- import com .google .firebase .firestore .util .Function ;
36+ import com .google .firebase .firestore .util .Predicate ;
3737import com .google .protobuf .InvalidProtocolBufferException ;
3838import com .google .protobuf .MessageLite ;
3939import java .util .ArrayList ;
4444import java .util .Map ;
4545import java .util .Set ;
4646import java .util .concurrent .Executor ;
47+
4748import javax .annotation .Nonnull ;
4849import javax .annotation .Nullable ;
4950
@@ -182,7 +183,7 @@ private Map<DocumentKey, MutableDocument> getAll(
182183 List <ResourcePath > collections ,
183184 IndexOffset offset ,
184185 int count ,
185- @ Nullable Function <MutableDocument , Boolean > filter ,
186+ @ Nullable Predicate <MutableDocument > filter ,
186187 @ Nullable QueryContext context ) {
187188 Timestamp readTime = offset .getReadTime ().getTimestamp ();
188189 DocumentKey documentKey = offset .getDocumentKey ();
@@ -234,15 +235,15 @@ private Map<DocumentKey, MutableDocument> getAll(
234235 List <ResourcePath > collections ,
235236 IndexOffset offset ,
236237 int count ,
237- @ Nullable Function <MutableDocument , Boolean > filter ) {
238+ @ Nullable Predicate <MutableDocument > filter ) {
238239 return getAll (collections , offset , count , filter , /*context*/ null );
239240 }
240241
241242 private void processRowInBackground (
242243 BackgroundQueue backgroundQueue ,
243244 Map <DocumentKey , MutableDocument > results ,
244245 Cursor row ,
245- @ Nullable Function <MutableDocument , Boolean > filter ) {
246+ @ Nullable Predicate <MutableDocument > filter ) {
246247 byte [] rawDocument = row .getBlob (0 );
247248 int readTimeSeconds = row .getInt (1 );
248249 int readTimeNanos = row .getInt (2 );
@@ -254,7 +255,7 @@ private void processRowInBackground(
254255 () -> {
255256 MutableDocument document =
256257 decodeMaybeDocument (rawDocument , readTimeSeconds , readTimeNanos );
257- if (filter == null || filter .apply (document )) {
258+ if (filter == null || filter .test (document )) {
258259 synchronized (results ) {
259260 results .put (document .getKey (), document );
260261 }
0 commit comments