Package io.realm.rx
Class CollectionChange<E extends OrderedRealmCollection>
- java.lang.Object
-
- io.realm.rx.CollectionChange<E>
-
public class CollectionChange<E extends OrderedRealmCollection> extends Object
Container wrapping the result of aOrderedRealmCollectionChangeListener
being triggered.This is used by
RealmResults.asChangesetObservable()
} andRealmList.asChangesetObservable()
as RxJava is only capable of emitting one item, not multiple.
-
-
Constructor Summary
Constructors Constructor Description CollectionChange(E collection, OrderedCollectionChangeSet changeset)
Constructor for a CollectionChange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
OrderedCollectionChangeSet
getChangeset()
Returns the changeset describing the update.E
getCollection()
Returns the collection that was updated.int
hashCode()
-
-
-
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.
-
-