SupportSQLiteOpenHelper.Configuration.Builder

open class SupportSQLiteOpenHelper.Configuration.Builder


Builder class for Configuration.

Summary

Public functions

open SupportSQLiteOpenHelper.Configuration.Builder
allowDataLossOnRecovery(allowDataLossOnRecovery: Boolean)

Sets whether to delete and recreate the database file in situations when the database file cannot be opened, thus allowing for its data to be lost.

open SupportSQLiteOpenHelper.Configuration

Throws an IllegalArgumentException if the Callback is null.

open SupportSQLiteOpenHelper.Configuration.Builder
open SupportSQLiteOpenHelper.Configuration.Builder
name(name: String?)
open SupportSQLiteOpenHelper.Configuration.Builder
noBackupDirectory(useNoBackupDirectory: Boolean)

Sets whether to use a no backup directory or not.

Public functions

allowDataLossOnRecovery

Added in 2.3.0
open fun allowDataLossOnRecovery(allowDataLossOnRecovery: Boolean): SupportSQLiteOpenHelper.Configuration.Builder

Sets whether to delete and recreate the database file in situations when the database file cannot be opened, thus allowing for its data to be lost.

Parameters
allowDataLossOnRecovery: Boolean

If true the database file might be recreated in the case that it cannot be opened.

build

Added in 2.0.0
open fun build(): SupportSQLiteOpenHelper.Configuration

Throws an IllegalArgumentException if the Callback is null.

Throws an IllegalArgumentException if the Context is null.

Throws an IllegalArgumentException if the String database name is null. Context.getNoBackupFilesDir

callback

Added in 2.0.0
open fun callback(callback: SupportSQLiteOpenHelper.Callback): SupportSQLiteOpenHelper.Configuration.Builder
Parameters
callback: SupportSQLiteOpenHelper.Callback

The callback class to handle creation, upgrade and downgrade.

Returns
SupportSQLiteOpenHelper.Configuration.Builder

This builder instance.

name

Added in 2.0.0
open fun name(name: String?): SupportSQLiteOpenHelper.Configuration.Builder
Parameters
name: String?

Name of the database file, or null for an in-memory database.

Returns
SupportSQLiteOpenHelper.Configuration.Builder

This builder instance.

noBackupDirectory

Added in 2.1.0
open fun noBackupDirectory(useNoBackupDirectory: Boolean): SupportSQLiteOpenHelper.Configuration.Builder

Sets whether to use a no backup directory or not.

Parameters
useNoBackupDirectory: Boolean

If true the database file will be stored in the no-backup directory.

Returns
SupportSQLiteOpenHelper.Configuration.Builder

This builder instance.