public class ObjectChange<E extends RealmModel> extends Object
RealmObjectChangeListener being triggered.
This is used by RealmObject.asChangesetObservable() and RealmObject.asChangesetObservable(RealmModel)
as RxJava is only capable of emitting one item, not multiple.
| Constructor and Description |
|---|
ObjectChange(E object,
ObjectChangeSet changeset)
Constructor for a ObjectChange.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ObjectChangeSet |
getChangeset()
Returns the changeset describing the update.
|
E |
getObject() |
int |
hashCode() |
String |
toString() |
public ObjectChange(E object, ObjectChangeSet changeset)
object - the object that was updated.changeset - the changeset describing the update.public E getObject()
public ObjectChangeSet getChangeset()
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
}
});