Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class CollectionChange

On this page

  • io.realm.rx
  • Constructors
  • Method Summary
  • Inherited Methods
  • Constructor Detail
  • Method Detail
  • equals
  • getChangeset
  • getCollection
  • hashCode
io.realm.rx.CollectionChange

Container wrapping the result of a io.realm.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

Constructor for a CollectionChange.

Modifier and Type
Method and Description
public boolean

Returns the changeset describing the update.

public E

Returns the collection that was updated.

public int
  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

E collection,
)

Constructor for a CollectionChange.

Parameters

  • collection - the collection that changed.

  • changeset - the changeset describing the change.

public boolean equals (
)

Overrides

equals in class Object

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.

public E getCollection ()

Returns the collection that was updated.

Returns

collection that was updated.

public int hashCode ()

Overrides

hashCode in class Object

Back

io.realm.rx

Next

ObjectChange