Class FirebaseArray<T>

  • All Implemented Interfaces:
    com.google.firebase.database.ChildEventListener, com.google.firebase.database.ValueEventListener, Iterable<T>, Collection<T>, List<T>

    public class FirebaseArray<T>
    extends ObservableSnapshotArray<T>
    implements com.google.firebase.database.ChildEventListener, com.google.firebase.database.ValueEventListener
    This class implements a collection on top of a Firebase location.
    • Constructor Detail

      • FirebaseArray

        public FirebaseArray​(@NonNull
                             com.google.firebase.database.Query query,
                             @NonNull
                             SnapshotParser<T> parser)
        Create a new FirebaseArray with a custom SnapshotParser.
        Parameters:
        query - The Firebase location to watch for data changes. Can also be a slice of a location, using some combination of limit(), startAt(), and endAt().
        See Also:
        ObservableSnapshotArray(SnapshotParser)
    • Method Detail

      • onCreate

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

        protected void onDestroy()
        Overrides:
        onDestroy in class com.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.database.DataSnapshot,​com.google.firebase.database.DatabaseError,​ChangeEventListener,​T>
      • onChildAdded

        public void onChildAdded​(@NonNull
                                 com.google.firebase.database.DataSnapshot snapshot,
                                 @Nullable
                                 String previousChildKey)
        Specified by:
        onChildAdded in interface com.google.firebase.database.ChildEventListener
      • onChildChanged

        public void onChildChanged​(@NonNull
                                   com.google.firebase.database.DataSnapshot snapshot,
                                   @Nullable
                                   String previousChildKey)
        Specified by:
        onChildChanged in interface com.google.firebase.database.ChildEventListener
      • onChildRemoved

        public void onChildRemoved​(@NonNull
                                   com.google.firebase.database.DataSnapshot snapshot)
        Specified by:
        onChildRemoved in interface com.google.firebase.database.ChildEventListener
      • onChildMoved

        public void onChildMoved​(@NonNull
                                 com.google.firebase.database.DataSnapshot snapshot,
                                 @Nullable
                                 String previousChildKey)
        Specified by:
        onChildMoved in interface com.google.firebase.database.ChildEventListener
      • onDataChange

        public void onDataChange​(@NonNull
                                 com.google.firebase.database.DataSnapshot snapshot)
        Specified by:
        onDataChange in interface com.google.firebase.database.ValueEventListener
      • onCancelled

        public void onCancelled​(@NonNull
                                com.google.firebase.database.DatabaseError error)
        Specified by:
        onCancelled in interface com.google.firebase.database.ChildEventListener
        Specified by:
        onCancelled in interface com.google.firebase.database.ValueEventListener
      • getSnapshots

        @NonNull
        protected List<com.google.firebase.database.DataSnapshot> getSnapshots()
        Specified by:
        getSnapshots in class com.firebase.ui.common.BaseObservableSnapshotArray<com.google.firebase.database.DataSnapshot,​com.google.firebase.database.DatabaseError,​ChangeEventListener,​T>