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 android.database.sqlite.SQLiteDatabase;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -65,12 +67,14 @@ public class LockHandler implements DBHandler {
|
|||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public DaoSession getDaoSession() {
|
public DaoSession getDaoSession() {
|
||||||
ensureNotClosed();
|
ensureNotClosed();
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public SQLiteDatabase getDatabase() {
|
public SQLiteDatabase getDatabase() {
|
||||||
ensureNotClosed();
|
ensureNotClosed();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Copyright (C) 2015-2024 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
/* Copyright (C) 2015-2026 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
||||||
Gobbetti, JohnnySun
|
Gobbetti, JohnnySun, Thomas Kuehne
|
||||||
|
|
||||||
This file is part of Gadgetbridge.
|
This file is part of Gadgetbridge.
|
||||||
|
|
||||||
@@ -19,16 +19,17 @@ package nodomain.freeyourgadget.gadgetbridge.database;
|
|||||||
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides low-level access to the database.
|
* Provides low-level access to the database.
|
||||||
*/
|
*/
|
||||||
public interface DBHandler extends AutoCloseable {
|
public interface DBHandler extends AutoCloseable {
|
||||||
@Override
|
@NonNull
|
||||||
void close() throws Exception;
|
|
||||||
|
|
||||||
SQLiteDatabase getDatabase();
|
SQLiteDatabase getDatabase();
|
||||||
|
|
||||||
|
@NonNull
|
||||||
DaoSession getDaoSession();
|
DaoSession getDaoSession();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user