SupportSQLiteOpenHelper.Configuration.Builder


public class SupportSQLiteOpenHelper.Configuration.Builder


Builder class for Configuration.

Summary

Public methods

@NonNull SupportSQLiteOpenHelper.Configuration.Builder
allowDataLossOnRecovery(boolean allowDataLossOnRecovery)

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.

@NonNull SupportSQLiteOpenHelper.Configuration

Throws an IllegalArgumentException if the Callback is null.

@NonNull SupportSQLiteOpenHelper.Configuration.Builder
@NonNull SupportSQLiteOpenHelper.Configuration.Builder
name(String name)
@NonNull SupportSQLiteOpenHelper.Configuration.Builder
noBackupDirectory(boolean useNoBackupDirectory)

Sets whether to use a no backup directory or not.

Public methods

allowDataLossOnRecovery

Added in 2.3.0
public @NonNull SupportSQLiteOpenHelper.Configuration.Builder allowDataLossOnRecovery(boolean allowDataLossOnRecovery)

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
boolean allowDataLossOnRecovery

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

build

Added in 2.0.0
public @NonNull SupportSQLiteOpenHelper.Configuration build()

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
public @NonNull SupportSQLiteOpenHelper.Configuration.Builder callback(@NonNull SupportSQLiteOpenHelper.Callback callback)
Parameters
@NonNull SupportSQLiteOpenHelper.Callback callback

The callback class to handle creation, upgrade and downgrade.

Returns
@NonNull SupportSQLiteOpenHelper.Configuration.Builder

This builder instance.

name

Added in 2.0.0
public @NonNull SupportSQLiteOpenHelper.Configuration.Builder name(String name)
Parameters
String name

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

Returns
@NonNull SupportSQLiteOpenHelper.Configuration.Builder

This builder instance.

noBackupDirectory

Added in 2.1.0
public @NonNull SupportSQLiteOpenHelper.Configuration.Builder noBackupDirectory(boolean useNoBackupDirectory)

Sets whether to use a no backup directory or not.

Parameters
boolean useNoBackupDirectory

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

Returns
@NonNull SupportSQLiteOpenHelper.Configuration.Builder

This builder instance.