public class CollectionChange<E extends OrderedRealmCollection> extends Object
OrderedRealmCollectionChangeListener being triggered.
This is used by RealmResults.asChangesetObservable()} and RealmList.asChangesetObservable() as
RxJava is only capable of emitting one item, not multiple.
| Constructor and Description |
|---|
CollectionChange(E collection,
OrderedCollectionChangeSet changeset)
Constructor for a CollectionChange.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
OrderedCollectionChangeSet |
getChangeset()
Returns the changeset describing the update.
|
E |
getCollection()
Returns the collection that was updated.
|
int |
hashCode() |
public CollectionChange(E collection, OrderedCollectionChangeSet changeset)
collection - the collection that changed.changeset - the changeset describing the change.public E getCollection()
public OrderedCollectionChangeSet getChangeset()
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
}
});