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).
CompactOnLaunchCallback
Link copied to clipboard
fun fun interface CompactOnLaunchCallback
This interface is used to determine if a Realm file should be compacted the first time the file is opened and before the instance is returned.
Configuration
Link copied to clipboard
interface Configuration
Base configuration options shared between all realm configuration types.
Deleteable
Link copied to clipboard
interface Deleteable
A deleteable is an entity that can be deleted in a write transaction or as part of a migration.
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 : Configuration
A Realm Configuration defining specific setup and configuration for a Realm instance.
RealmInstant
Link copied to clipboard
interface RealmInstant : Comparable<RealmInstant>
A representation of a Realm timestamp.
RealmList
Link copied to clipboard
interface RealmList<E> : MutableList<E> , Deleteable
RealmList is used to model one-to-many relationships in a RealmObject.
RealmObject
Link copied to clipboard
interface RealmObject : Deleteable
Marker interface to define a model (managed by Realm).
RealmResults
Link copied to clipboard
interface RealmResults<T : RealmObject> : List<T> , Deleteable, 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

asFlow
Link copied to clipboard
fun <T : RealmObject> T.asFlow(): Flow<ObjectChange<T>>
Observe changes to a Realm object.
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.
query
Link copied to clipboard
inline fun <T : RealmObject> MutableRealm.query(query: String = "TRUEPREDICATE", vararg args: Any?): RealmQuery<T>
Returns a RealmQuery matching the predicate represented by query.
inline fun <T : RealmObject> Realm.query(query: String = "TRUEPREDICATE", vararg args: Any?): RealmQuery<T>
Returns a RealmQuery matching the predicate represented by query.
inline fun <T : RealmObject> TypedRealm.query(query: String = "TRUEPREDICATE", vararg args: Any?): RealmQuery<T>
Returns a RealmQuery matching the predicate represented by query.
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.