Package io.realm.kotlin

Functions

addChangeListener
Link copied to clipboard
fun <E : RealmModel> E.addChangeListener(listener: RealmChangeListener<E>)
Adds a change listener to a RealmObject that will be triggered if any value field or referenced RealmObject field is changed, or the RealmList field itself is changed.
fun <E : RealmModel> E.addChangeListener(listener: RealmObjectChangeListener<E>)
Adds a change listener to a RealmObject to get detailed information about the changes.
createEmbeddedObject
Link copied to clipboard
inline fun <T : RealmModel> Realm.createEmbeddedObject(parentObject: RealmModel, parentProperty: String): T
Instantiates and adds a new embedded object to the Realm.
createObject
Link copied to clipboard
inline fun <T : RealmModel> Realm.createObject(): T
Instantiates and adds a new object to the Realm.
inline fun <T : RealmModel> Realm.createObject(primaryKeyValue: Any?): T
Instantiates and adds a new object to the Realm with the primary key value already set.
delete
Link copied to clipboard
inline fun <T : RealmModel> Realm.delete()
Deletes all objects of the specified class from the Realm.
deleteFromRealm
Link copied to clipboard
fun RealmModel.deleteFromRealm()
Deletes the object from the Realm it is currently associated with.
executeTransactionAwait
Link copied to clipboard
suspend fun Realm.executeTransactionAwait(context: CoroutineContext = Realm.WRITE_EXECUTOR.asCoroutineDispatcher(), transaction: (realm: Realm) -> Unit)
Suspend version of Realm.executeTransaction to use within coroutines.
freeze
Link copied to clipboard
fun <T : RealmModel> RealmModel.freeze(): T
Returns a frozen snapshot of this object.
isFrozen
Link copied to clipboard
fun RealmModel.isFrozen(): Boolean
Returns whether or not this RealmModel is frozen.
isLoaded
Link copied to clipboard
fun RealmModel.isLoaded(): Boolean
Checks if the query used to find this RealmObject has completed.
isManaged
Link copied to clipboard
fun RealmModel.isManaged(): Boolean
Checks if this object is managed by Realm.
isValid
Link copied to clipboard
fun RealmModel.isValid(): Boolean
Checks if the RealmObject is still valid to use i.e., the RealmObject hasn't been deleted nor has the Realm been closed.
load
Link copied to clipboard
fun RealmModel.load(): Boolean
Makes an asynchronous query blocking.
oneOf
Link copied to clipboard
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Date?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Boolean?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Byte?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Double?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Float?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Int?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Long?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out Short?>): RealmQuery<T>
In comparison.
fun <T : RealmModel> RealmQuery<T>.oneOf(propertyName: String, value: Array<out String?>, casing: Case = Case.SENSITIVE): RealmQuery<T>
In comparison.
removeAllChangeListeners
Link copied to clipboard
fun RealmModel.removeAllChangeListeners()
Removes all registered listeners from the given RealmObject.
removeChangeListener
Link copied to clipboard
fun <E : RealmModel> E.removeChangeListener(listener: RealmChangeListener<E>)
Removes a previously registered listener on the given RealmObject.
fun <E : RealmModel> E.removeChangeListener(listener: RealmObjectChangeListener<E>)
Removes a previously registered listener on the given RealmObject.
toChangesetFlow
Link copied to clipboard
fun <T : RealmModel> T?.toChangesetFlow(): Flow<ObjectChange<T>?>
Returns a Flow that monitors changes to this RealmObject.
fun <T> RealmList<T>.toChangesetFlow(): Flow<CollectionChange<RealmList<T>>>
Returns a Flow that monitors changes to this RealmList.
fun <T : RealmModel> RealmResults<T>.toChangesetFlow(): Flow<CollectionChange<RealmResults<T>>>
Returns a Flow that monitors changes to this RealmResults.
toFlow
Link copied to clipboard
fun DynamicRealm.toflow(): Flow<DynamicRealm>
Creates a Flow for a DynamicRealm.
fun Realm.toflow(): Flow<Realm>
Creates a Flow for a Realm.
where
Link copied to clipboard
inline fun <T : RealmModel> Realm.where(): RealmQuery<T>
Returns a typed RealmQuery, which can be used to query for specific objects of this type

Properties

syncSession
Link copied to clipboard
val Realm.syncSession: SyncSession
Returns the SyncSession associated with this Realm.