Package io.realm.kotlin.ext

Functions

asBsonObjectId
Link copied to clipboard
fun ObjectId.asBsonObjectId(): BsonObjectId
asFlow
Link copied to clipboard
fun <T : BaseRealmObject> T.asFlow(): Flow<ObjectChange<T>>
Observe changes to a Realm object.
asRealmObject
Link copied to clipboard
inline fun <T : BaseRealmObject> RealmAny.asRealmObject(): T
Creates an unmanaged RealmAny instance from a BaseRealmObject value.
backlinks
Link copied to clipboard
inline fun <T : TypedRealmObject> EmbeddedRealmObject.backlinks(sourceProperty: KProperty1<T, *>): EmbeddedBacklinksDelegate<T>
Returns a BacklinksDelegate that represents the inverse relationship between two an EmbeddedRealmObject and a TypedRealmObject.
inline fun <T : TypedRealmObject> RealmObject.backlinks(sourceProperty: KProperty1<T, *>): BacklinksDelegate<T>
Returns a BacklinksDelegate that represents the inverse relationship between two Realm models.
fun <T : TypedRealmObject> EmbeddedRealmObject.backlinks(sourceProperty: KProperty1<T, *>, sourceClass: KClass<T>): EmbeddedBacklinksDelegate<T>
Defines a backlink that represents a one-to-one inverse relationship between an EmbeddedRealmObject and a TypedRealmObject.
fun <T : TypedRealmObject> RealmObject.backlinks(sourceProperty: KProperty1<T, *>, sourceClass: KClass<T>): BacklinksDelegate<T>
Defines a collection of backlinks that represents the inverse relationship between two Realm models.
copyFromRealm
Link copied to clipboard
inline fun <T : TypedRealmObject> T.copyFromRealm(depth: UInt = UInt.MAX_VALUE): T
Makes an unmanaged in-memory copy of an already persisted io.realm.kotlin.types.RealmObject.
inline fun <T : TypedRealmObject> RealmResults<T>.copyFromRealm(depth: UInt = UInt.MAX_VALUE): List<T>
Makes an unmanaged in-memory copy of the elements in a RealmResults.
inline fun <T : TypedRealmObject> RealmList<T>.copyFromRealm(depth: UInt = UInt.MAX_VALUE): List<T>
Makes an unmanaged in-memory copy of the elements in a managed RealmList.
inline fun <T : RealmObject> RealmSet<T>.copyFromRealm(depth: UInt = UInt.MAX_VALUE): Set<T>
Makes an unmanaged in-memory copy of the elements in a managed RealmSet.
isFrozen
Link copied to clipboard
fun BaseRealmObject.isFrozen(): Boolean
Returns whether the object is frozen or not.
isManaged
Link copied to clipboard
fun BaseRealmObject.isManaged(): Boolean
Returns whether or not this object is managed by Realm.
isValid
Link copied to clipboard
fun BaseRealmObject.isValid(): Boolean
Returns true if this object is still valid to use, i.e.
parent
Link copied to clipboard
inline fun <T : TypedRealmObject> EmbeddedRealmObject.parent(): T
Returns a TypedRealmObject that represents the parent that hosts the embedded object.
fun <T : TypedRealmObject> EmbeddedRealmObject.parent(parentClass: KClass<T>): T
Gets the parent of the embedded object, embedded objects always have an unique parent, that could be a RealmObject or another EmbeddedRealmObject.
query
Link copied to clipboard
inline fun <T : BaseRealmObject> MutableRealm.query(query: String = TRUE_PREDICATE, vararg args: Any?): RealmQuery<T>
Returns a RealmQuery matching the predicate represented by query.
inline fun <T : BaseRealmObject> Realm.query(query: String = TRUE_PREDICATE, vararg args: Any?): RealmQuery<T>
Returns a RealmQuery matching the predicate represented by query.
inline fun <T : BaseRealmObject> TypedRealm.query(query: String = TRUE_PREDICATE, vararg args: Any?): RealmQuery<T>
Returns a RealmQuery matching the predicate represented by query.
fun <T : BaseRealmObject> RealmList<T>.query(filter: String = TRUE_PREDICATE, vararg arguments: Any?): RealmQuery<T>
Query the objects of a list by the filter and arguments.
realmListOf
Link copied to clipboard
fun <T> realmListOf(vararg elements: T): RealmList<T>
Instantiates an unmanagedRealmList.
realmSetOf
Link copied to clipboard
fun <T> realmSetOf(vararg elements: T): RealmSet<T>
Instantiates an unmanagedRealmSet.
toRealmList
Link copied to clipboard
fun <T> Iterable<T>.toRealmList(): RealmList<T>
Instantiates an unmanagedRealmList containing all the elements of this iterable.
toRealmSet
Link copied to clipboard
fun <T> Iterable<T>.toRealmSet(): RealmSet<T>
Instantiates an unmanagedRealmSet containing all the elements of this iterable.
version
Link copied to clipboard
fun BaseRealmObject.version(): VersionId
Returns the Realm version of this object.