Package io.realm.rx

Class ObjectChange<E extends RealmModel>

    • Constructor Detail

      • ObjectChange

        public ObjectChange​(E object,
                            @Nullable
                            ObjectChangeSet changeset)
        Constructor for a ObjectChange.
        Parameters:
        object - the object that was updated.
        changeset - the changeset describing the update.
    • Method Detail

      • getObject

        public E getObject()
      • getChangeset

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

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

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

        public int hashCode()
        Overrides:
        hashCode in class Object