Package com.firebase.ui.database
Class FirebaseListOptions.Builder<T>
- java.lang.Object
-
- com.firebase.ui.database.FirebaseListOptions.Builder<T>
-
- Type Parameters:
T- the model class for theFirebaseListAdapter.
- Enclosing class:
- FirebaseListOptions<T>
public static final class FirebaseListOptions.Builder<T> extends Object
Builder forFirebaseListOptions.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FirebaseListOptions<T>build()Build aFirebaseListOptionsfrom the provided arguments.FirebaseListOptions.Builder<T>setIndexedQuery(com.google.firebase.database.Query keyQuery, com.google.firebase.database.DatabaseReference dataRef, SnapshotParser<T> parser)Set an indexed query to listen on and aSnapshotParserto parse data snapshots.FirebaseListOptions.Builder<T>setIndexedQuery(com.google.firebase.database.Query keyQuery, com.google.firebase.database.DatabaseReference dataRef, Class<T> modelClass)Set an indexed query to listen on and aClassto which data snapshots should be converted.FirebaseListOptions.Builder<T>setLayout(int layout)Set the resource ID for the item layout.FirebaseListOptions.Builder<T>setLifecycleOwner(androidx.lifecycle.LifecycleOwner owner)Set the optionalLifecycleOwner.FirebaseListOptions.Builder<T>setQuery(com.google.firebase.database.Query query, SnapshotParser<T> parser)Set the query to listen on and aSnapshotParserto parse data snapshots.FirebaseListOptions.Builder<T>setQuery(com.google.firebase.database.Query query, Class<T> modelClass)Set the query to listen on and aClassto which data snapshots should be converted.FirebaseListOptions.Builder<T>setSnapshotArray(ObservableSnapshotArray<T> snapshots)Directly set theObservableSnapshotArrayto observe.
-
-
-
Method Detail
-
setSnapshotArray
@NonNull public FirebaseListOptions.Builder<T> setSnapshotArray(@NonNull ObservableSnapshotArray<T> snapshots)
Directly set theObservableSnapshotArrayto observe.Do not call this method after calling
setQuery.
-
setQuery
@NonNull public FirebaseListOptions.Builder<T> setQuery(@NonNull com.google.firebase.database.Query query, @NonNull SnapshotParser<T> parser)
Set the query to listen on and aSnapshotParserto parse data snapshots.Do not call this method after calling
setSnapshotArray(ObservableSnapshotArray).
-
setQuery
@NonNull public FirebaseListOptions.Builder<T> setQuery(@NonNull com.google.firebase.database.Query query, @NonNull Class<T> modelClass)
Set the query to listen on and aClassto which data snapshots should be converted. Do not call this method after callingsetSnapshotArray(ObservableSnapshotArray).
-
setIndexedQuery
@NonNull public FirebaseListOptions.Builder<T> setIndexedQuery(@NonNull com.google.firebase.database.Query keyQuery, @NonNull com.google.firebase.database.DatabaseReference dataRef, @NonNull SnapshotParser<T> parser)
Set an indexed query to listen on and aSnapshotParserto parse data snapshots. The keyQuery is used to find a list of IDs, which are then queried at the dataRef.Do not call this method after calling
setSnapshotArray(ObservableSnapshotArray).
-
setIndexedQuery
@NonNull public FirebaseListOptions.Builder<T> setIndexedQuery(@NonNull com.google.firebase.database.Query keyQuery, @NonNull com.google.firebase.database.DatabaseReference dataRef, @NonNull Class<T> modelClass)
Set an indexed query to listen on and aClassto which data snapshots should be converted. The keyQuery is used to find a list of keys, which are then queried at the dataRef.Do not call this method after calling
setSnapshotArray(ObservableSnapshotArray).
-
setLayout
@NonNull public FirebaseListOptions.Builder<T> setLayout(@LayoutRes int layout)
Set the resource ID for the item layout.
-
setLifecycleOwner
@NonNull public FirebaseListOptions.Builder<T> setLifecycleOwner(@Nullable androidx.lifecycle.LifecycleOwner owner)
Set the optionalLifecycleOwner. Listening will stop/start after the appropriate lifecycle events.
-
build
@NonNull public FirebaseListOptions<T> build()
Build aFirebaseListOptionsfrom the provided arguments.
-
-