Package io.realm

Core functions and types.

Types

BaseRealm
Link copied to clipboard
interface BaseRealm : Versioned

Base class for all Realm instances (Realm and MutableRealm).

LogConfiguration
Link copied to clipboard
data class LogConfiguration(level: LogLevel, loggers: List<RealmLogger>)

Configuration for log events created by a Realm instance.

MutableRealm
Link copied to clipboard
interface MutableRealm : TypedRealm

Represents the writeable state of a Realm file.

Queryable
Link copied to clipboard
interface Queryable<T : RealmObject>

Interface holding common query methods.

Realm
Link copied to clipboard
interface Realm : TypedRealm

A Realm instance is the main entry point for interacting with a persisted realm.

RealmConfiguration
Link copied to clipboard
interface RealmConfiguration

A Realm Configuration defining specific setup and configuration for a Realm instance.

RealmList
Link copied to clipboard
interface RealmList<E> : MutableList<E>

RealmList is used to model one-to-many relationships in a RealmObject.

RealmObject
Link copied to clipboard
interface RealmObject

Marker interface to define a model (managed by Realm).

RealmResults
Link copied to clipboard
interface RealmResults<T : RealmObject> : List<T> , Queryable<T> , Versioned

A Realm Result holds the results of querying the Realm.

TypedRealm
Link copied to clipboard
interface TypedRealm : BaseRealm

A typed realm that can be queried for objects of a specific type.

Versioned
Link copied to clipboard
interface Versioned
VersionId
Link copied to clipboard
data class VersionId(version: Long) : Comparable<VersionId>

A VersionId representing the transactional id of the Realm itself or it's objects.

Functions

delete
Link copied to clipboard
fun RealmObject.delete()

Deletes the RealmObject.

isFrozen
Link copied to clipboard
fun RealmObject.isFrozen(): Boolean

Returns whether the object is frozen or not.

isManaged
Link copied to clipboard
fun RealmObject.isManaged(): Boolean

Returns whether or not this object is managed by Realm.

isValid
Link copied to clipboard
fun RealmObject.isValid(): Boolean

Returns true if this object is still valid to use, i.e. the Realm is open and the underlying object has not been deleted. Unmanaged objects are always valid.

objects
Link copied to clipboard
inline fun <T : RealmObject> TypedRealm.objects(): RealmResults<T>

Returns the results of querying for all objects of a specific type.

observe
Link copied to clipboard
fun <T : RealmObject> T.observe(): Flow<T>

Observe changes to a Realm object. Any change to the object, will cause the flow to emit the updated object. If the observed object is deleted from the Realm, the flow will complete, otherwise it will continue running until canceled.

realmListOf
Link copied to clipboard
fun <T> realmListOf(vararg elements: T): RealmList<T>

Instantiates an unmanagedRealmList.

toRealmList
Link copied to clipboard
fun <T> Iterable<T>.toRealmList(): RealmList<T>

Instantiates an unmanagedRealmList containing all the elements of this iterable.

version
Link copied to clipboard
fun RealmObject.version(): VersionId

Returns the Realm version of this object. This version number is tied to the transaction the object was read from.