Package io.realm.rx
Class ObjectChange<E extends RealmModel>
- java.lang.Object
-
- io.realm.rx.ObjectChange<E>
-
public class ObjectChange<E extends RealmModel> extends Object
Container wrapping the result of aRealmObjectChangeListener
being triggered.This is used by
RealmObject.asChangesetObservable()
andRealmObject.asChangesetObservable(RealmModel)
as RxJava is only capable of emitting one item, not multiple.
-
-
Constructor Summary
Constructors Constructor Description ObjectChange(E object, ObjectChangeSet changeset)
Constructor for a ObjectChange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
ObjectChangeSet
getChangeset()
Returns the changeset describing the update.E
getObject()
int
hashCode()
String
toString()
-
-
-
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.
-
-