MCPcopy Create free account
hub / github.com/M66B/FairEmail / databaseBuilder

Method databaseBuilder

app/src/main/java/androidx/room/Room.java:47–58  ·  view source on GitHub ↗

Creates a RoomDatabase.Builder for a persistent database. Once a database is built, you should keep a reference to it and re-use it. @param context The context for the database. This is usually the Application context. @param klass The abstract class which is annotated with Database and e

(
            @NonNull Context context, @NonNull Class<T> klass, @NonNull String name)

Source from the content-addressed store, hash-verified

45 * @return A {@code RoomDatabaseBuilder<T>} which you can use to create the database.
46 */
47 @SuppressWarnings("WeakerAccess")
48 @NonNull
49 public static <T extends RoomDatabase> RoomDatabase.Builder<T> databaseBuilder(
50 @NonNull Context context, @NonNull Class<T> klass, @NonNull String name) {
51 //noinspection ConstantConditions
52 if (name == null || name.trim().length() == 0) {
53 throw new IllegalArgumentException("Cannot build a database with null or empty name."
54 + " If you are trying to create an in memory database, use Room"
55 + ".inMemoryDatabaseBuilder");
56 }
57 return new RoomDatabase.Builder<>(context, klass, name);
58 }
59
60 /**
61 * Creates a RoomDatabase.Builder for an in memory database. Information stored in an in memory

Callers 1

getBuilderMethod · 0.95

Calls 2

trimMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected