Interface FlowFactory
-
- All Known Implementing Classes:
RealmFlowFactory
public interface FlowFactoryFactory interface for creating KotlinFlows for Realm classes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description kotlinx.coroutines.flow.Flow<ObjectChange<DynamicRealmObject>>changesetFrom(DynamicRealm dynamicRealm, DynamicRealmObject dynamicRealmObject)Creates aFlowfor aDynamicRealmObject.<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmList<T>>>changesetFrom(DynamicRealm dynamicRealm, RealmList<T> list)Creates aFlowfor aRealmList.<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmResults<T>>>changesetFrom(DynamicRealm dynamicRealm, RealmResults<T> results)Creates aFlowfor aRealmResultsinstance.<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmList<T>>>changesetFrom(Realm realm, RealmList<T> list)Creates aFlowfor aRealmList.<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmResults<T>>>changesetFrom(Realm realm, RealmResults<T> results)Creates aFlowfor aRealmResultsinstance.<T extends RealmModel>
kotlinx.coroutines.flow.Flow<ObjectChange<T>>changesetFrom(Realm realm, T realmObject)Creates aFlowfor aRealmObject.kotlinx.coroutines.flow.Flow<DynamicRealm>from(DynamicRealm dynamicRealm)Creates aFlowfor aDynamicRealm.kotlinx.coroutines.flow.Flow<DynamicRealmObject>from(DynamicRealm dynamicRealm, DynamicRealmObject dynamicRealmObject)Creates aFlowfor aDynamicRealmObject.<T> kotlinx.coroutines.flow.Flow<RealmList<T>>from(DynamicRealm dynamicRealm, RealmList<T> realmList)Creates aFlowfor aRealmList.<T> kotlinx.coroutines.flow.Flow<RealmResults<T>>from(DynamicRealm dynamicRealm, RealmResults<T> results)Creates aFlowfor aRealmResults.kotlinx.coroutines.flow.Flow<Realm>from(Realm realm)Creates aFlowfor aRealm.<T> kotlinx.coroutines.flow.Flow<RealmList<T>>from(Realm realm, RealmList<T> realmList)Creates aFlowfor aRealmList.<T> kotlinx.coroutines.flow.Flow<RealmResults<T>>from(Realm realm, RealmResults<T> results)Creates aFlowfor aRealmResults.<T extends RealmModel>
kotlinx.coroutines.flow.Flow<T>from(Realm realm, T realmObject)Creates aFlowfor aRealmObject.
-
-
-
Method Detail
-
from
kotlinx.coroutines.flow.Flow<Realm> from(@Nonnull Realm realm)
Creates aFlowfor aRealm. It should emit the initial state of the Realm when subscribed to and on each subsequent update of the Realm.- Parameters:
realm-Realminstance being observed for changes to be emitted by the flow.- Returns:
- Flow that emits all updates to the Realm.
-
from
kotlinx.coroutines.flow.Flow<DynamicRealm> from(@Nonnull DynamicRealm dynamicRealm)
Creates aFlowfor aDynamicRealm. It should emit the initial state of the Realm when subscribed to and on each subsequent update of the Realm.- Parameters:
dynamicRealm-DynamicRealminstance being observed for changes to be emitted by the flow.- Returns:
- Flow that emits all updates to the Realm.
-
from
<T> kotlinx.coroutines.flow.Flow<RealmResults<T>> from(@Nonnull Realm realm, @Nonnull RealmResults<T> results)
Creates aFlowfor aRealmResults. It should emit the initial RealmResult when subscribed to and on each subsequent update of the RealmResults.- Type Parameters:
T- type of RealmObject.- Parameters:
results-RealmResultsinstance being observed for changes to be emitted by the flow.realm-Realminstance from where the results are coming.- Returns:
Flowthat emits all updates to the RealmObject.
-
changesetFrom
<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmResults<T>>> changesetFrom(@Nonnull Realm realm, @Nonnull RealmResults<T> results)
Creates aFlowfor aRealmResultsinstance. It should emit the initial results when subscribed to and on each subsequent update of the results it should emit the results plus theCollectionChangethat 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.
- Parameters:
realm-Realminstance from where the object is coming.results-RealmResultsinstance being observed for changes to be emitted by the flow.- Returns:
Flowthat emits all updates to the RealmResults.
-
from
<T> kotlinx.coroutines.flow.Flow<RealmResults<T>> from(@Nonnull DynamicRealm dynamicRealm, @Nonnull RealmResults<T> results)
Creates aFlowfor aRealmResults. It should emit the initial RealmResult when subscribed to and on each subsequent update of the RealmResults.- Type Parameters:
T- type of RealmObject.- Parameters:
results-RealmResultsinstance being observed for changes to be emitted by the flow.dynamicRealm-DynamicRealminstance from where the results are coming.- Returns:
Flowthat emits all updates to the RealmObject.
-
changesetFrom
<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmResults<T>>> changesetFrom(@Nonnull DynamicRealm dynamicRealm, @Nonnull RealmResults<T> results)
Creates aFlowfor aRealmResultsinstance. It should emit the initial results when subscribed to and on each subsequent update of the results it should emit the results plus theCollectionChangethat 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.
- Parameters:
dynamicRealm-DynamicRealminstance from where the object is coming.results-RealmResultsinstance being observed for changes to be emitted by the flow.- Returns:
Flowthat emits all updates to the RealmResults.
-
from
<T> kotlinx.coroutines.flow.Flow<RealmList<T>> from(@Nonnull Realm realm, @Nonnull RealmList<T> realmList)
Creates aFlowfor aRealmList. It should emit the initial RealmResult when subscribed to and on each subsequent update of the RealmList.Note:
RealmChangeListeneris currently not supported on RealmLists.
-
changesetFrom
<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmList<T>>> changesetFrom(@Nonnull Realm realm, @Nonnull RealmList<T> list)
Creates aFlowfor aRealmList. It should emit the initial list when subscribed to and on each subsequent update of the list it should emit the list plus theCollectionChangethat 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.
-
from
<T> kotlinx.coroutines.flow.Flow<RealmList<T>> from(@Nonnull DynamicRealm dynamicRealm, @Nonnull RealmList<T> realmList)
Creates aFlowfor aRealmList. It should emit the initial RealmResult when subscribed to and on each subsequent update of the RealmList.Note:
RealmChangeListeneris currently not supported on RealmLists.- Type Parameters:
T- type of RealmObject- Parameters:
realmList-RealmListinstance being observed for changes to be emitted by the flow.dynamicRealm-DynamicRealminstance from where the results are coming.- Returns:
Flowthat emit all updates to the RealmList.
-
changesetFrom
<T> kotlinx.coroutines.flow.Flow<CollectionChange<RealmList<T>>> changesetFrom(@Nonnull DynamicRealm dynamicRealm, @Nonnull RealmList<T> list)
Creates aFlowfor aRealmList. It should emit the initial list when subscribed to and on each subsequent update of the list it should emit the list plus theCollectionChangethat 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.
- Parameters:
dynamicRealm-DynamicRealminstance from where the object is coming.list-RealmListinstance being observed for changes to be emitted by the flow.- Returns:
Flowthat emits all updates to the RealmList.
-
from
<T extends RealmModel> kotlinx.coroutines.flow.Flow<T> from(@Nonnull Realm realm, @Nonnull T realmObject)
Creates aFlowfor aRealmObject. It should emit the initial object when subscribed to and on each subsequent update of the object.- Type Parameters:
T- type of query target- Parameters:
realmObject-RealmObjectinstance being observed for changes to be emitted by the flow.realm-Realminstance from where the object is coming.- Returns:
Flowthat emits all updates to the DynamicRealmObject.
-
changesetFrom
<T extends RealmModel> kotlinx.coroutines.flow.Flow<ObjectChange<T>> changesetFrom(@Nonnull Realm realm, @Nonnull T realmObject)
Creates aFlowfor aRealmObject. It should emit the initial object when subscribed to and on each subsequent update of the object it should emit the object plus theObjectChangeSetthat 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.
- Parameters:
realm-Realminstance from where the object is coming.realmObject-RealmObjectinstance being observed for changes to be emitted by the flow.- Returns:
Flowthat emits all updates to the DynamicRealmObject.
-
from
kotlinx.coroutines.flow.Flow<DynamicRealmObject> from(@Nonnull DynamicRealm dynamicRealm, @Nonnull DynamicRealmObject dynamicRealmObject)
Creates aFlowfor aDynamicRealmObject. It should emit the initial object when subscribed to and on each subsequent update of the object.- Parameters:
dynamicRealm-DynamicRealminstance from where the object is coming.dynamicRealmObject-DynamicRealmObjectinstance being observed for changes to be emitted by the flow.- Returns:
Flowthat emits all updates to the DynamicRealmObject.
-
changesetFrom
kotlinx.coroutines.flow.Flow<ObjectChange<DynamicRealmObject>> changesetFrom(@Nonnull DynamicRealm dynamicRealm, @Nonnull DynamicRealmObject dynamicRealmObject)
Creates aFlowfor aDynamicRealmObject. It should emit the initial object when subscribed to and on each subsequent update of the object it should emit the object plus theObjectChangeSetthat 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.
- Parameters:
dynamicRealm-DynamicRealminstance from where the object is coming.dynamicRealmObject-DynamicRealmObjectinstance being observed for changes to be emitted by the flow.- Returns:
Flowthat emits all updates to the DynamicRealmObject.
-
-