Class 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.
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • 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 void onCreate()  
      protected void onDestroy()  
      void onEvent​(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
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • 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:
        getSnapshots in class com.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.firestore.DocumentSnapshot,​com.google.firebase.firestore.FirebaseFirestoreException,​ChangeEventListener,​T>
      • onCreate

        protected void onCreate()
        Overrides:
        onCreate in class com.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.firestore.DocumentSnapshot,​com.google.firebase.firestore.FirebaseFirestoreException,​ChangeEventListener,​T>
      • onDestroy

        protected void onDestroy()
        Overrides:
        onDestroy in class com.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:
        onEvent in interface com.google.firebase.firestore.EventListener<T>