Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /
io.realm

Class RealmConfiguration

java.lang.Object
io.realm.RealmConfiguration

A RealmConfiguration is used to setup a specific Realm instance.Instances of a RealmConfiguration can only created by using the io.realm.RealmConfiguration.Builder and calling its io.realm.RealmConfiguration.Builder.build() method.

A commonly used RealmConfiguration can easily be accessed by first saving it as Realm.setDefaultConfiguration(RealmConfiguration) and then using io.realm.Realm.getDefaultInstance() .

A minimal configuration can be created using:

RealmConfiguration config = new RealmConfiguration.Builder().build()

Esto creará una RealmConfiguration con las siguientes propiedades.

  • Realm file is called "default.realm"

  • It is saved in Context.getFilesDir()

  • Tiene su versión de esquema establecida en 0.

Modificador y Tipo
Clase y descripción

public static

Modificador y Tipo
Campo y Descripción

public static final String

Modificador y Tipo
Método y descripción

protected static RealmProxyMediator

public booleano

protegido static RealmConfiguration

String canonicalPath,
byte[] encryptionKey,
RealmProxyMediator schemaMediator
)

public String

Returns the path to the Realm asset file.

Devuelve una devolución de llamada para determinar si el archivo Realm debe compactarse antes de devolverlo al usuario.

público OsRealmConfig.Durability

public byte

Devuelve el FlowFactory que se utiliza para crear Flujos de Kotlin a partir de objetos Realm.

Returns the transaction instance with initial data.

protected Realm

OsSharedRealm.VersionID version
)

public long

public String

Returns the absolute path to where the Realm file will be saved.

public archivo

public String

public Set

Returns the unmodifiable Set of model classes that make up the schema for this Realm.

Returns the RxObservableFactory that is used to create Rx Observables from Realm objects.

protected RealmProxyMediator

Returns the mediator instance of schema which is defined by this configuration.

public long

public booleano

Indicates if an asset file has been configured for this configuration.

public int

public booleano

Devuelve si un RealmQuery puede lanzarse desde el hilo de la Interfaz de Usuario.

public booleano

Returns whether calls to Realm.executeTransaction can be done on the UI thread.

public booleano

Returns whether this Realm is read-only or not.

public booleano

protected boolean

protected boolean

Verifica si el archivo Realm definido por esta configuración ya existe.

public booleano

public String

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

protected static RealmProxyMediator createSchemaMediator (
)
public boolean equals (
Object obj
)

Anulaciones

equals en la clase Objeto

protected static RealmConfiguration forRecovery (
String canonicalPath,
byte[] encryptionKey,
RealmProxyMediator schemaMediator
)

Returns the path to the Realm asset file.

Devuelve

path to the asset file relative to the asset directory or null if not asset file was specified.

Devuelve una devolución de llamada para determinar si el archivo Realm debe compactarse antes de devolverlo al usuario.

Devuelve

una función de retorno que se llama al abrir un Realm por primera vez durante la vida de un proceso para determinar si debe compactarse antes de devolverse al usuario. Se le pasa el tamaño total del archivo (datos + espacio libre) y el total de bytes utilizados por los datos en el archivo.

public OsRealmConfig.Durability getDurability ()

public byte getEncryptionKey ()

Devuelve el FlowFactory que se utiliza para crear Flujos de Kotlin a partir de objetos Realm.

Devuelve

the factory instance used to create Flows.

Throws

Returns the transaction instance with initial data.

Devuelve

la transacción de datos inicial.

protected Realm getInstance (
OsSharedRealm.VersionID version
)

Devuelve

el número máximo de versiones activas permitidas antes de que se produzca una excepción.

public String getPath ()

Returns the absolute path to where the Realm file will be saved.

Devuelve

the absolute path to the Realm file defined by this configuration.

Returns the unmodifiable Set of model classes that make up the schema for this Realm.

Devuelve

unmodifiable Set of model classes.

Returns the RxObservableFactory that is used to create Rx Observables from Realm objects.

Devuelve

the factory instance used to create Rx Observables.

Throws

protected RealmProxyMediator getSchemaMediator ()

Returns the mediator instance of schema which is defined by this configuration.

Devuelve

El mediador del esquema.

public long getSchemaVersion ()

public boolean hasAssetFile ()

Indicates if an asset file has been configured for this configuration.

Devuelve

true si hay archivo de activos, false en caso contrario.

public int hashCode ()

Anulaciones

hashCode en la clase Objeto

public boolean isAllowQueriesOnUiThread ()

Devuelve si un RealmQuery puede lanzarse desde el hilo de la Interfaz de Usuario.

By default Realm allows queries on the main thread. To disallow this users have to explicitly opt in with Builder.allowQueriesOnUiThread(boolean) or its Realm Sync builder counterpart.

Devuelve

si se permite o no ejecutar consultas desde el hilo de UI.

public boolean isAllowWritesOnUiThread ()

Returns whether calls to Realm.executeTransaction can be done on the UI thread.

Nota: Realm no permite ejecutar transacciones bloqueantes en el hilo principal, a menos que los usuarios lo elijan explícitamente con Builder.allowWritesOnUiThread(boolean) o su equivalente en Realm sincronizar builder.

Devuelve

whether or not write operations are allowed to be run from the UI thread.

public boolean isReadOnly ()

Returns whether this Realm is read-only or not. Read-only Realms cannot be modified and will throw an IllegalStateException if Realm.beginTransaction() is called on it.

Devuelve

true si este Realm es solo lectura, false si no.

public boolean isRecoveryConfiguration ()

Devuelve

true if this configuration is intended to open a backup Realm (as a result of a client reset).

Tip

  • {@link ClientResetRequiredError}

protected boolean isSyncConfiguration ()

protected boolean realmExists ()

Checks if the Realm file defined by this configuration already exists.WARNING: This method is just a point-in-time check. Unless protected by external synchronization another thread or process might have created or deleted the Realm file right after this method has returned.

Devuelve

true si el archivo Realm existe, false de lo contrario.

public String toString ()

Anulaciones

toString en la clase Objeto

Volver

RealmCollection