Package com.firebase.ui.firestore.paging
Class FirestorePagingOptions.Builder<T>
- java.lang.Object
-
- com.firebase.ui.firestore.paging.FirestorePagingOptions.Builder<T>
-
- Enclosing class:
- FirestorePagingOptions<T>
public static final class FirestorePagingOptions.Builder<T> extends java.lang.ObjectBuilder forFirestorePagingOptions.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FirestorePagingOptions<T>build()Build theFirestorePagingOptionsobject.FirestorePagingOptions.Builder<T>setDiffCallback(androidx.recyclerview.widget.DiffUtil.ItemCallback<com.google.firebase.firestore.DocumentSnapshot> diffCallback)Sets an optional customDiffUtil.ItemCallbackto compareDocumentSnapshotobjects.FirestorePagingOptions.Builder<T>setLifecycleOwner(androidx.lifecycle.LifecycleOwner owner)Sets an optionalLifecycleOwnerto control the lifecycle of the adapter.FirestorePagingOptions.Builder<T>setQuery(com.google.firebase.firestore.Query query, androidx.paging.PagedList.Config config, SnapshotParser<T> parser)Sets the query usingSource.DEFAULTand a customSnapshotParser.FirestorePagingOptions.Builder<T>setQuery(com.google.firebase.firestore.Query query, androidx.paging.PagedList.Config config, java.lang.Class<T> modelClass)Sets the query usingSource.DEFAULTand aClassSnapshotParserbased on the given Class.FirestorePagingOptions.Builder<T>setQuery(com.google.firebase.firestore.Query query, com.google.firebase.firestore.Source source, androidx.paging.PagedList.Config config, SnapshotParser<T> parser)Sets the Firestore query to paginate.FirestorePagingOptions.Builder<T>setQuery(com.google.firebase.firestore.Query query, com.google.firebase.firestore.Source source, androidx.paging.PagedList.Config config, java.lang.Class<T> modelClass)Sets the query using a customSourceand aClassSnapshotParserbased on the given class.
-
-
-
Method Detail
-
setQuery
@NonNull public FirestorePagingOptions.Builder<T> setQuery(@NonNull com.google.firebase.firestore.Query query, @NonNull androidx.paging.PagedList.Config config, @NonNull java.lang.Class<T> modelClass)
Sets the query usingSource.DEFAULTand aClassSnapshotParserbased on the given Class. SeesetQuery(Query, Source, PagedList.Config, SnapshotParser).
-
setQuery
@NonNull public FirestorePagingOptions.Builder<T> setQuery(@NonNull com.google.firebase.firestore.Query query, @NonNull androidx.paging.PagedList.Config config, @NonNull SnapshotParser<T> parser)
Sets the query usingSource.DEFAULTand a customSnapshotParser. SeesetQuery(Query, Source, PagedList.Config, SnapshotParser).
-
setQuery
@NonNull public FirestorePagingOptions.Builder<T> setQuery(@NonNull com.google.firebase.firestore.Query query, @NonNull com.google.firebase.firestore.Source source, @NonNull androidx.paging.PagedList.Config config, @NonNull java.lang.Class<T> modelClass)
Sets the query using a customSourceand aClassSnapshotParserbased on the given class. SeesetQuery(Query, Source, PagedList.Config, SnapshotParser).
-
setQuery
@NonNull public FirestorePagingOptions.Builder<T> setQuery(@NonNull com.google.firebase.firestore.Query query, @NonNull com.google.firebase.firestore.Source source, @NonNull androidx.paging.PagedList.Config config, @NonNull SnapshotParser<T> parser)
Sets the Firestore query to paginate.- Parameters:
query- the Firestore query. This query should only contain where() and orderBy() clauses. Any limit() or pagination clauses will cause errors.source- the data source to use for query data.config- paging configuration, passed directly to the support paging library.parser- theSnapshotParserto parseDocumentSnapshotinto model objects.- Returns:
- this, for chaining.
-
setDiffCallback
@NonNull public FirestorePagingOptions.Builder<T> setDiffCallback(@NonNull androidx.recyclerview.widget.DiffUtil.ItemCallback<com.google.firebase.firestore.DocumentSnapshot> diffCallback)
Sets an optional customDiffUtil.ItemCallbackto compareDocumentSnapshotobjects. The default implementation isDefaultSnapshotDiffCallback.- Returns:
- this, for chaining.
-
setLifecycleOwner
@NonNull public FirestorePagingOptions.Builder<T> setLifecycleOwner(@NonNull androidx.lifecycle.LifecycleOwner owner)
Sets an optionalLifecycleOwnerto control the lifecycle of the adapter. Otherwise, you must manually callFirestorePagingAdapter.startListening()andFirestorePagingAdapter.stopListening().- Returns:
- this, for chaining.
-
build
@NonNull public FirestorePagingOptions<T> build()
Build theFirestorePagingOptionsobject.
-
-