SharedBuilder

abstract class SharedBuilder<T, S : Configuration.SharedBuilder<T, S>>(schema: Set<KClass<out RealmObject>>)

Base class for configuration builders that holds properties available to both RealmConfiguration and SyncConfiguration.

Parameters

T

the type of Configuration the builder should generate.

S

the type of builder, needed to distinguish between local and sync variants.

Constructors

SharedBuilder
Link copied to clipboard
fun SharedBuilder(schema: Set<KClass<out RealmObject>> = setOf())
the type of Configuration the builder should generate.

Functions

build
Link copied to clipboard
abstract fun build(): T
Creates the RealmConfiguration based on the builder properties.
encryptionKey
Link copied to clipboard
fun encryptionKey(encryptionKey: ByteArray): S
Sets the 64 byte key used to encrypt and decrypt the Realm file.
log
Link copied to clipboard
open fun log(level: LogLevel = LogLevel.WARN, customLoggers: List<RealmLogger> = emptyList()): S
Configure how Realm will report log events.
maxNumberOfActiveVersions
Link copied to clipboard
fun maxNumberOfActiveVersions(maxVersions: Long = 8): S
Sets the maximum number of live versions in the Realm file before an IllegalStateException is thrown when attempting to write more data.
name
Link copied to clipboard
fun name(name: String): S
Sets the filename of the realm file.
path
Link copied to clipboard
fun path(path: String?): S
Sets the absolute path of the realm file.
schema
Link copied to clipboard
fun schema(vararg classes: KClass<out RealmObject>): S
Sets the classes of the schema.
fun schema(classes: Set<KClass<out RealmObject>>): S
Sets the classes of the schema.
schemaVersion
Link copied to clipboard
fun schemaVersion(schemaVersion: Long): S
Sets the schema version of the Realm.

Properties

schema
Link copied to clipboard
var schema: Set<KClass<out RealmObject>>

Inheritors

RealmConfiguration
Link copied to clipboard