kotlin-extensions / io.realm.kotlin / io.realm.Realm

Extensions for io.realm.Realm

classPermissions

fun <T : RealmModel> Realm.classPermissions(): ClassPermissions

Returns all permissions associated with the given class. Attach a change listener using ClassPermissions.addChangeListener to be notified about any future changes.

createObject

fun <T : RealmModel> Realm.createObject(): T

Instantiates and adds a new object to the Realm.

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

fun <T : RealmModel> Realm.delete(): Unit

Deletes all objects of the specified class from the Realm.

syncSession

val Realm.syncSession: SyncSession

Returns the SyncSession associated with this Realm.

where

fun <T : RealmModel> Realm.where(): RealmQuery<T>

Returns a typed RealmQuery, which can be used to query for specific objects of this type