mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
DBHandler: add @Nullable / @NonNull annotations
This commit is contained in:
@@ -18,6 +18,8 @@ package nodomain.freeyourgadget.gadgetbridge;
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -65,12 +67,14 @@ public class LockHandler implements DBHandler {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public DaoSession getDaoSession() {
|
||||
ensureNotClosed();
|
||||
return session;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SQLiteDatabase getDatabase() {
|
||||
ensureNotClosed();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright (C) 2015-2024 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
||||
Gobbetti, JohnnySun
|
||||
/* Copyright (C) 2015-2026 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
||||
Gobbetti, JohnnySun, Thomas Kuehne
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
@@ -19,16 +19,17 @@ package nodomain.freeyourgadget.gadgetbridge.database;
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
|
||||
/**
|
||||
* Provides low-level access to the database.
|
||||
*/
|
||||
public interface DBHandler extends AutoCloseable {
|
||||
@Override
|
||||
void close() throws Exception;
|
||||
|
||||
@NonNull
|
||||
SQLiteDatabase getDatabase();
|
||||
|
||||
@NonNull
|
||||
DaoSession getDaoSession();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user