package androidx.room; import android.content.Context; import androidx.annotation.NonNull; import androidx.room.RoomDatabase; import c.d.b.a.a; public class Room { private static final String CURSOR_CONV_SUFFIX = "_CursorConverter"; public static final String LOG_TAG = "ROOM"; public static final String MASTER_TABLE_NAME = "room_master_table"; @NonNull public static RoomDatabase.Builder databaseBuilder(@NonNull Context context, @NonNull Class cls, @NonNull String str) { if (str != null && str.trim().length() != 0) { return new RoomDatabase.Builder<>(context, cls, str); } throw new IllegalArgumentException("Cannot build a database with null or empty name. If you are trying to create an in memory database, use Room.inMemoryDatabaseBuilder"); } @NonNull public static T getGeneratedImplementation(Class cls, String str) { String str2; String name = cls.getPackage().getName(); String canonicalName = cls.getCanonicalName(); if (!name.isEmpty()) { canonicalName = canonicalName.substring(name.length() + 1); } String str3 = canonicalName.replace('.', '_') + str; try { if (name.isEmpty()) { str2 = str3; } else { str2 = name + "." + str3; } return (T) Class.forName(str2).newInstance(); } catch (ClassNotFoundException unused) { StringBuilder L = a.L("cannot find implementation for "); L.append(cls.getCanonicalName()); L.append(". "); L.append(str3); L.append(" does not exist"); throw new RuntimeException(L.toString()); } catch (IllegalAccessException unused2) { StringBuilder L2 = a.L("Cannot access the constructor"); L2.append(cls.getCanonicalName()); throw new RuntimeException(L2.toString()); } catch (InstantiationException unused3) { StringBuilder L3 = a.L("Failed to create an instance of "); L3.append(cls.getCanonicalName()); throw new RuntimeException(L3.toString()); } } @NonNull public static RoomDatabase.Builder inMemoryDatabaseBuilder(@NonNull Context context, @NonNull Class cls) { return new RoomDatabase.Builder<>(context, cls, null); } }