io.realm
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.
Nested Class Summary
Modificador y Tipo | Clase y descripción |
|---|---|
|
Field Summary
Modificador y Tipo | Campo y Descripción |
|---|---|
public static final String |
Resumen del método
Modificador y Tipo | Método y descripción |
|---|---|
protected static RealmProxyMediator | java.util.Set<java.lang.Object> modules, boolean excludeDebugSchema ) |
public booleano | |
protegido static RealmConfiguration | |
public String | Returns the path to the Realm asset file. |
public CompactOnLaunchCallback | 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 | |
public FlowFactory | Devuelve el FlowFactory que se utiliza para crear Flujos de Kotlin a partir de objetos Realm. |
protected Realm.Transaction | Returns the transaction instance with initial data. |
protected Realm | |
public long | |
público RealmMigration | getMigration () |
public String | getPath () 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. |
public RxObservableFactory | getRxFactory () 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 | hasAssetFile () Indicates if an asset file has been configured for this configuration. |
public int | hashCode () |
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 | isReadOnly () Returns whether this Realm is read-only or not. |
public booleano | |
protected boolean | |
protected boolean | realmExists () Verifica si el archivo Realm definido por esta configuración ya existe. |
public booleano | |
public String | toString () |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass,hashCode,equals,clone,toString,notify,notifyAll,wait,wait,wait,finalize
Detalle del Campo
DEFAULT_REALM_NAME
Detalle del método
createSchemaMediator
protected static RealmProxyMediator createSchemaMediator ( java.util.Set<java.lang.Object> modules, boolean excludeDebugSchema ) |
|---|
equals
forRecovery
protected static RealmConfiguration forRecovery ( ) |
|---|
getAssetFilePath
public String getAssetFilePath () |
|---|
Returns the path to the Realm asset file. Devuelve path to the asset file relative to the asset directory or |
getCompactOnLaunchCallback
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. |
getDurability
public OsRealmConfig.Durability getDurability () |
|---|
obtenerClaveDeCifrado
public byte getEncryptionKey () |
|---|
getFlowFactory
public FlowFactory getFlowFactory () |
|---|
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
|
getInitialDataTransaction
protected Realm.Transaction getInitialDataTransaction () |
|---|
Returns the transaction instance with initial data. Devuelve la transacción de datos inicial. |
getInstance
getMaxNumberOfActiveVersions
public long getMaxNumberOfActiveVersions () |
|---|
Devuelve el número máximo de versiones activas permitidas antes de que se produzca una excepción. |
getMigration
public RealmMigration getMigration () |
|---|
getPath
getRealmDirectory
public File getRealmDirectory () |
|---|
getRealmFileName
public String getRealmFileName () |
|---|
getRealmObjectClasses
public Set getRealmObjectClasses () |
|---|
getRxFactory
public RxObservableFactory getRxFactory () |
|---|
Returns the RxObservableFactory that is used to create Rx Observables from Realm objects. Devuelve the factory instance used to create Rx Observables. Throws
|
getSchemaMediator
protected RealmProxyMediator getSchemaMediator () |
|---|
Returns the mediator instance of schema which is defined by this configuration. Devuelve El mediador del esquema. |
getSchemaVersion
public long getSchemaVersion () |
|---|
hasAssetFile
public boolean hasAssetFile () |
|---|
Indicates if an asset file has been configured for this configuration. Devuelve
|
hashCode
isAllowQueriesOnUiThread
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. |
isAllowWritesOnUiThread
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. |
isReadOnly
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
|
isRecoveryConfiguration
public boolean isRecoveryConfiguration () |
|---|
Devuelve
Tip
|
isSyncConfiguration
protected boolean isSyncConfiguration () |
|---|
realmExists
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
|
shouldDeleteRealmIfMigrationNeeded
public boolean shouldDeleteRealmIfMigrationNeeded () |
|---|