package com.andrewkydev.database; public final class DatabaseProvider { private static volatile DatabaseApi api; private DatabaseProvider() { } public static void set(DatabaseApi api) { DatabaseProvider.api = api; } public static DatabaseApi get() { DatabaseApi current = api; if (current == null) { throw new IllegalStateException("DatabaseApi is not initialized"); } return current; } }