Package io.realm.rx

Class CollectionChange<E extends OrderedRealmCollection>

    • Constructor Detail

      • CollectionChange

        public CollectionChange​(E collection,
                                @Nullable
                                OrderedCollectionChangeSet changeset)
        Constructor for a CollectionChange.
        Parameters:
        collection - the collection that changed.
        changeset - the changeset describing the change.
    • Method Detail

      • getCollection

        public E getCollection()
        Returns the collection that was updated.
        Returns:
        collection that was updated.
      • getChangeset

        @Nullable
        public OrderedCollectionChangeSet getChangeset()
        Returns the changeset describing the update.

        This will be null the first time the stream emits the collection as well as when a asynchronous query is loaded for the first time.

         
         // Example
         realm.where(Person.class).findAllAsync().asChangesetObservable()
           .subscribe(new Consumer<CollectionChange>() {
            \@Override
             public void accept(CollectionChange item) throws Exception {
               item.getChangeset(); // Will return null the first two times
           }
         });
         
         
        Returns:
        the changeset describing how the collection was updated.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object