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 : RealmObject> RealmDictionary<T?>.copyFromRealm(depth: UInt = UInt.MAX_VALUE): Map<String, T?>
Makes an unmanaged in-memory copy of the elements in a managed RealmDictionary.
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> RealmDictionary<T?>.query(filter: String = TRUE_PREDICATE, vararg arguments: Any?): RealmQuery<T>
Query the objects in a dictionary by filter and arguments.
fun <T : BaseRealmObject> RealmList<T>.query(filter: String = TRUE_PREDICATE, vararg arguments: Any?): RealmQuery<T>
Query the objects in a list by filter and arguments.
fun <T : BaseRealmObject> RealmSet<T>.query(filter: String = TRUE_PREDICATE, vararg arguments: Any?): RealmQuery<T>
Query the objects in a set by filter and arguments.
realmDictionaryEntryOf
Link copied to clipboard
fun <V> realmDictionaryEntryOf(pair: Pair<String, V>): RealmDictionaryMutableEntry<V>
Instantiates an unmanagedRealmDictionaryMutableEntry from a Pair of String and V that can be added to an entry set produced by RealmDictionary.entries.
fun <V> realmDictionaryEntryOf(entry: Map.Entry<String, V>): RealmDictionaryMutableEntry<V>
Instantiates an unmanagedRealmMapMutableEntry from another Map.Entry that can be added to an entry set produced by RealmDictionary.entries.
fun <V> realmDictionaryEntryOf(key: String, value: V): RealmDictionaryMutableEntry<V>
Instantiates an unmanagedRealmMapMutableEntry from a key-value pair that can be added to an entry set produced by RealmDictionary.entries.
realmDictionaryOf
Link copied to clipboard
fun <T> realmDictionaryOf(vararg elements: Pair<String, T>): RealmDictionary<T>
Instantiates an unmanagedRealmDictionary from a variable number of Pairs of String and T.
fun <T> realmDictionaryOf(elements: Collection<Pair<String, T>>): RealmDictionary<T>
Instantiates an unmanagedRealmDictionary from a Collection of Pairs of String and T.
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.
toRealmDictionary
Link copied to clipboard
fun <T> Iterable<Pair<String, T>>.toRealmDictionary(): RealmDictionary<T>
Instantiates an unmanagedRealmDictionary containing all the elements of this iterable of Pairs of Strings and Ts.
fun <T> Map<String, T>.toRealmDictionary(): RealmDictionary<T>
Instantiates an unmanagedRealmDictionary containing all the elements of the receiver dictionary represented by a Map of String to T pairs.
fun <T> RealmDictionaryEntrySet<T>.toRealmDictionary(): RealmDictionary<T>
Instantiates an unmanagedRealmDictionary containing all the elements of the receiver RealmDictionaryEntrySet.
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.