public class RealmObservableFactory extends Object implements RxObservableFactory
Constructor and Description |
---|
RealmObservableFactory(boolean emitFrozenObjects)
Constructs the factory for creating Realm observables for RxJava.
|
Modifier and Type | Method and Description |
---|---|
<any> |
changesetsFrom(DynamicRealm realm,
DynamicRealmObject object)
Creates an Observable for a
RealmObject . |
<E> <any> |
changesetsFrom(DynamicRealm realm,
RealmList<E> list)
Creates an Observable for a
RealmList . |
<E> <any> |
changesetsFrom(DynamicRealm realm,
RealmResults<E> results)
Creates an Observable for a
RealmResults . |
<E extends RealmModel> |
changesetsFrom(Realm realm,
E object)
Creates an Observable for a
RealmObject . |
<E> <any> |
changesetsFrom(Realm realm,
RealmList<E> list)
Creates an Observable for a
RealmList . |
<E> <any> |
changesetsFrom(Realm realm,
RealmResults<E> results)
Creates an Observable for a
RealmResults . |
boolean |
equals(Object o) |
<any> |
from(DynamicRealm realm)
Creates a Flowable for a
DynamicRealm . |
<any> |
from(DynamicRealm realm,
DynamicRealmObject object)
Creates a Flowable for a
DynamicRealmObject . |
<E> <any> |
from(DynamicRealm realm,
RealmList<E> list)
Creates a Flowable for a
RealmList . |
<E> <any> |
from(DynamicRealm realm,
RealmQuery<E> query)
Creates a Single from a
RealmQuery . |
<E> <any> |
from(DynamicRealm realm,
RealmResults<E> results)
Creates a Flowable for a
RealmResults . |
<any> |
from(Realm realm)
Creates a Flowable for a
Realm . |
<E extends RealmModel> |
from(Realm realm,
E object)
Creates a Flowable for a
RealmObject . |
<E> <any> |
from(Realm realm,
RealmList<E> list)
Creates an Observable for a
RealmList . |
<E> <any> |
from(Realm realm,
RealmQuery<E> query)
Creates a Single from a
RealmQuery . |
<E> <any> |
from(Realm realm,
RealmResults<E> results)
Creates a Flowable for a
RealmResults . |
int |
hashCode() |
public RealmObservableFactory(boolean emitFrozenObjects)
emitFrozenObjects
- true
if all objects should be frozen before being returned
to the user. false
if they should be live objects.public <any> from(Realm realm)
RxObservableFactory
Realm
. It should emit the initial state of the Realm when subscribed to and
on each subsequent update of the Realm.
Realm flowables are hot as Realms are automatically kept up to date.
from
in interface RxObservableFactory
realm
- Realm
to listen to changes for.public <any> from(DynamicRealm realm)
RxObservableFactory
DynamicRealm
. It should emit the initial state of the Realm when subscribed
to and on each subsequent update of the Realm.
DynamicRealm observables are hot as DynamicRealms are automatically kept up to date.
from
in interface RxObservableFactory
realm
- DynamicRealm
to listen to changes for.public <E> <any> from(Realm realm, RealmResults<E> results)
RxObservableFactory
RealmResults
. It should emit the initial RealmResult when subscribed to and
on each subsequent update of the RealmResults.
RealmResults observables are hot as RealmResults are automatically kept up to date.
from
in interface RxObservableFactory
E
- type of RealmObjectrealm
- Realm
instance results are coming from.results
- RealmResults
to listen to changes for.public <E> <any> changesetsFrom(Realm realm, RealmResults<E> results)
RxObservableFactory
RealmResults
. It should emit the initial RealmResult when subscribed to and
on each subsequent update of the RealmResults it should emit the RealmResults + the OrderedCollectionChangeSet
that describes the update.
Changeset observables do not support backpressure as a changeset depends on the state of the previous changeset. Handling backpressure should therefor be left to users.
changesetsFrom
in interface RxObservableFactory
E
- type of RealmObjectrealm
- Realm
instance results are coming from.results
- RealmResults
to listen to changes for.public <E> <any> from(DynamicRealm realm, RealmResults<E> results)
RxObservableFactory
RealmResults
. It should emit the initial RealmResult when subscribed to and
on each subsequent update of the RealmResults.
Realm observables are hot as RealmResults are automatically kept up to date.
from
in interface RxObservableFactory
realm
- DynamicRealm
instance results are coming from.results
- RealmResults
to listen to changes for.public <E> <any> changesetsFrom(DynamicRealm realm, RealmResults<E> results)
RxObservableFactory
RealmResults
. It should emit the initial RealmResult when subscribed to and
on each subsequent update of the RealmResults it should emit the RealmResults + the OrderedCollectionChangeSet
that describes the update.
Changeset observables do not support backpressure as a changeset depends on the state of the previous changeset. Handling backpressure should therefor be left to users.
changesetsFrom
in interface RxObservableFactory
realm
- Realm
instance results are coming from.results
- RealmResults
to listen to changes for.public <E> <any> from(Realm realm, RealmList<E> list)
RxObservableFactory
RealmList
. It should emit the initial list when subscribed to and on each
subsequent update of the RealmList.
RealmList observables are hot as RealmLists are automatically kept up to date.
Note: RealmChangeListener
is currently not supported on RealmLists.
from
in interface RxObservableFactory
E
- type of query targetrealm
- Realm
instance list is coming from.list
- RealmObject to listen to changes for.public <E> <any> changesetsFrom(Realm realm, RealmList<E> list)
RxObservableFactory
RealmList
. It should emit the initial RealmList when subscribed to and
on each subsequent update of the RealmIst it should emit the RealmList + the OrderedCollectionChangeSet
that describes the update.
Changeset observables do not support backpressure as a changeset depends on the state of the previous changeset. Handling backpressure should therefor be left to users.
changesetsFrom
in interface RxObservableFactory
E
- type of RealmObjectrealm
- Realm
instance list is coming from.list
- RealmList
to listen to changes for.public <E> <any> from(DynamicRealm realm, RealmList<E> list)
RxObservableFactory
RealmList
. It should emit the initial list when subscribed to and on each
subsequent update of the RealmList.
RealmList observables are hot as RealmLists are automatically kept up to date.
Note: RealmChangeListener
is currently not supported on RealmLists.
from
in interface RxObservableFactory
realm
- DynamicRealm
instance list is coming from.list
- RealmList to listen to changes for.public <E> <any> changesetsFrom(DynamicRealm realm, RealmList<E> list)
RxObservableFactory
RealmList
. It should emit the initial RealmList when subscribed to and
on each subsequent update of the RealmList it should emit the RealmList + the OrderedCollectionChangeSet
that describes the update.
Changeset observables do not support backpressure as a changeset depends on the state of the previous changeset. Handling backpressure should therefor be left to users.
changesetsFrom
in interface RxObservableFactory
realm
- Realm
instance list is coming from.list
- RealmList
to listen to changes for.public <E extends RealmModel> <any> from(Realm realm, E object)
RxObservableFactory
RealmObject
. It should emit the initial object when subscribed to and on each
subsequent update of the object.
RealmObject observables are hot as RealmObjects are automatically kept up to date.
from
in interface RxObservableFactory
E
- type of query targetrealm
- Realm
instance object is coming from.object
- RealmObject to listen to changes for.public <E extends RealmModel> <any> changesetsFrom(Realm realm, E object)
RxObservableFactory
RealmObject
. It should emit the initial object when subscribed to and on each
subsequent update of the object it should emit the object + the ObjectChangeSet
that describes
the update.
Changeset observables do not support backpressure as a changeset depends on the state of the previous changeset. Handling backpressure should therefore be left to the user.
changesetsFrom
in interface RxObservableFactory
E
- type of RealmObjectrealm
- Realm
instance object is coming from.object
- RealmObject to listen to changes for.public <any> from(DynamicRealm realm, DynamicRealmObject object)
RxObservableFactory
DynamicRealmObject
. It should emit the initial object when subscribed to and
on each subsequent update of the object.
DynamicRealmObject observables are hot as DynamicRealmObjects automatically are kept up to date.
from
in interface RxObservableFactory
realm
- DynamicRealm
instance object is coming from.object
- DynamicRealmObject to listen to changes for.public <any> changesetsFrom(DynamicRealm realm, DynamicRealmObject object)
RxObservableFactory
RealmObject
. It should emit the initial object when subscribed to and on each
subsequent update of the object it should emit the object + the ObjectChangeSet
that describes
the update.
Changeset observables do not support backpressure as a changeset depends on the state of the previous changeset. Handling backpressure should therefore be left to the user.
changesetsFrom
in interface RxObservableFactory
realm
- Realm
instance object is coming from.object
- RealmObject to listen to changes for.public <E> <any> from(Realm realm, RealmQuery<E> query)
RxObservableFactory
RealmQuery
. It should emit the query and then complete.
A RealmQuery observable is cold.
from
in interface RxObservableFactory
E
- type of query targetrealm
- Realm
instance query is coming from.query
- RealmQuery to emit.public <E> <any> from(DynamicRealm realm, RealmQuery<E> query)
RxObservableFactory
RealmQuery
. It should emit the query and then complete.
A RealmQuery observable is cold.
from
in interface RxObservableFactory
realm
- DynamicRealm
instance query is coming from.query
- RealmObject to listen to changes for.