Package com.firebase.ui.firestore
Class FirestoreArray<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- com.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.firestore.DocumentSnapshot,com.google.firebase.firestore.FirebaseFirestoreException,ChangeEventListener,T>
-
- com.firebase.ui.firestore.ObservableSnapshotArray<T>
-
- com.firebase.ui.firestore.FirestoreArray<T>
-
- All Implemented Interfaces:
com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>,java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>
public class FirestoreArray<T> extends ObservableSnapshotArray<T> implements com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>
Exposes a Firestore query as an observable list of objects.
-
-
Constructor Summary
Constructors Constructor Description FirestoreArray(com.google.firebase.firestore.Query query, SnapshotParser<T> parser)Create a new FirestoreArray.FirestoreArray(com.google.firebase.firestore.Query query, com.google.firebase.firestore.MetadataChanges changes, SnapshotParser<T> parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<com.google.firebase.firestore.DocumentSnapshot>getSnapshots()protected voidonCreate()protected voidonDestroy()voidonEvent(com.google.firebase.firestore.QuerySnapshot snapshots, com.google.firebase.firestore.FirebaseFirestoreException e)-
Methods inherited from class com.firebase.ui.common.BaseObservableSnapshotArray
addChangeEventListener, clear, get, getSnapshot, isListening, isListening, notifyOnChildChanged, notifyOnDataChanged, notifyOnError, removeAllListeners, removeChangeEventListener, size
-
Methods inherited from class java.util.AbstractList
add, add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
FirestoreArray
public FirestoreArray(@NonNull com.google.firebase.firestore.Query query, @NonNull SnapshotParser<T> parser)Create a new FirestoreArray.- Parameters:
query- query to listen to.parser- parser for DocumentSnapshots.- See Also:
ObservableSnapshotArray(SnapshotParser)
-
FirestoreArray
public FirestoreArray(@NonNull com.google.firebase.firestore.Query query, @NonNull com.google.firebase.firestore.MetadataChanges changes, @NonNull SnapshotParser<T> parser)- Parameters:
changes- metadata options for the query listen.- See Also:
FirestoreArray(Query, SnapshotParser)
-
-
Method Detail
-
getSnapshots
@NonNull protected java.util.List<com.google.firebase.firestore.DocumentSnapshot> getSnapshots()
- Specified by:
getSnapshotsin classcom.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.firestore.DocumentSnapshot,com.google.firebase.firestore.FirebaseFirestoreException,ChangeEventListener,T>
-
onCreate
protected void onCreate()
- Overrides:
onCreatein classcom.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.firestore.DocumentSnapshot,com.google.firebase.firestore.FirebaseFirestoreException,ChangeEventListener,T>
-
onDestroy
protected void onDestroy()
- Overrides:
onDestroyin classcom.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.firestore.DocumentSnapshot,com.google.firebase.firestore.FirebaseFirestoreException,ChangeEventListener,T>
-
onEvent
public void onEvent(@Nullable com.google.firebase.firestore.QuerySnapshot snapshots, @Nullable com.google.firebase.firestore.FirebaseFirestoreException e)- Specified by:
onEventin interfacecom.google.firebase.firestore.EventListener<T>
-
-