annotate JvmStatic for more idiomatic access from Java

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-06-23 20:13:09 +02:00
parent 74fc56fa7e
commit c9ba0fe870
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 2 additions and 1 deletions

View file

@ -93,6 +93,6 @@ public class DatabaseModule {
@Provides
@Singleton
public TalkDatabase provideTalkDatabase(@NonNull final Context context) {
return TalkDatabase.Companion.getInstance(context);
return TalkDatabase.getInstance(context);
}
}

View file

@ -62,6 +62,7 @@ abstract class TalkDatabase : RoomDatabase() {
@Volatile
private var INSTANCE: TalkDatabase? = null
@JvmStatic
fun getInstance(context: Context): TalkDatabase =
INSTANCE ?: synchronized(this) {
INSTANCE ?: build(context).also { INSTANCE = it }