room/runtime/src/main/java/androidx/room/RoomDatabase.java
@NonNull
        public T build() {
            //noinspection ConstantConditions
            if (mContext == null) {
                throw new IllegalArgumentException("Cannot provide null context for the database.");
            }
            //noinspection ConstantConditions
            if (mDatabaseClass == null) {
                throw new IllegalArgumentException("Must provide an abstract class that"
                        + " extends RoomDatabase");
            }

            if (mMigrationStartAndEndVersions != null && mMigrationsNotRequiredFrom != null) {
                for (Integer version : mMigrationStartAndEndVersions) {
                    if (mMigrationsNotRequiredFrom.contains(version)) {
                        throw new IllegalArgumentException(
                                "Inconsistency detected. A Migration was supplied to "
                                        + "addMigration(Migration... migrations) that has a start "
                                        + "or end version equal to a start version supplied to "
                                        + "fallbackToDestructiveMigrationFrom(int... "
                                        + "startVersions). Start version: "
                                        + version);
                    }
                }
            }

            if (mFactory == null) {
                mFactory = new FrameworkSQLiteOpenHelperFactory();
            }
            DatabaseConfiguration configuration =
                    new DatabaseConfiguration(mContext, mName, mFactory, mMigrationContainer,
                            mCallbacks, mAllowMainThreadQueries,
                            mJournalMode.resolve(mContext),
                            mRequireMigration, mMigrationsNotRequiredFrom);
            T db = Room.getGeneratedImplementation(mDatabaseClass, DB_IMPL_SUFFIX);
            db.init(configuration);
            return db;
        }
/**
         * Creates the databases and initializes it.
         * <p>
         * By default, all RoomDatabases use in memory storage for TEMP tables and enables recursive
         * triggers.
         *
         * @return A new database instance.
         */
Creates the databases and initializes it.

By default, all RoomDatabases use in memory storage for TEMP tables and enables recursive
triggers.

@return A new database instance.
Creates the databases and initializes it . By default all RoomDatabases use in memory storage for TEMP tables and enables recursive triggers . @return A new database instance .
@NonNull
        public T build() {
            if (mContext == null) {
                throw new IllegalArgumentException("Cannot provide null context for the database.");
            }
            if (mDatabaseClass == null) {
                throw new IllegalArgumentException("Must provide an abstract class that"
                        + " extends RoomDatabase");
            }
            if (mMigrationStartAndEndVersions != null && mMigrationsNotRequiredFrom != null) {
                for (Integer version : mMigrationStartAndEndVersions) {
                    if (mMigrationsNotRequiredFrom.contains(version)) {
                        throw new IllegalArgumentException(
                                "Inconsistency detected. A Migration was supplied to "
                                        + "addMigration(Migration... migrations) that has a start "
                                        + "or end version equal to a start version supplied to "
                                        + "fallbackToDestructiveMigrationFrom(int... "
                                        + "startVersions). Start version: "
                                        + version);
                    }
                }
            }
            if (mFactory == null) {
                mFactory = new FrameworkSQLiteOpenHelperFactory();
            }
            DatabaseConfiguration configuration =
                    new DatabaseConfiguration(mContext, mName, mFactory, mMigrationContainer,
                            mCallbacks, mAllowMainThreadQueries,
                            mJournalMode.resolve(mContext),
                            mRequireMigration, mMigrationsNotRequiredFrom);
            T db = Room.getGeneratedImplementation(mDatabaseClass, DB_IMPL_SUFFIX);
            db.init(configuration);
            return db;
        }
@ NonNull public T build ( ) { if ( mContext == null ) { throw new IllegalArgumentException ( "Cannot provide null context for the database." ) ; } if ( mDatabaseClass == null ) { throw new IllegalArgumentException ( "Must provide an abstract class that" + " extends RoomDatabase" ) ; } if ( mMigrationStartAndEndVersions != null && mMigrationsNotRequiredFrom != null ) { for ( Integer version : mMigrationStartAndEndVersions ) { if ( mMigrationsNotRequiredFrom . contains ( version ) ) { throw new IllegalArgumentException ( "Inconsistency detected. A Migration was supplied to " + "addMigration(Migration... migrations) that has a start " + "or end version equal to a start version supplied to " + "fallbackToDestructiveMigrationFrom(int... " + "startVersions). Start version: " + version ) ; } } } if ( mFactory == null ) { mFactory = new FrameworkSQLiteOpenHelperFactory ( ) ; } DatabaseConfiguration configuration = new DatabaseConfiguration ( mContext , mName , mFactory , mMigrationContainer , mCallbacks , mAllowMainThreadQueries , mJournalMode . resolve ( mContext ) , mRequireMigration , mMigrationsNotRequiredFrom ) ; T db = Room . getGeneratedImplementation ( mDatabaseClass , DB_IMPL_SUFFIX ) ; db . init ( configuration ) ; return db ; }
Creates the databases and initializes it.
Creates the databases and initializes it .
//noinspection ConstantConditions //noinspection ConstantConditions