From 4cbc30171c909a6ecfc0cc8006353a22ba734d3f Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 8 Feb 2021 14:56:23 +0100 Subject: [PATCH] explicitly specify return type in AppRepository --- .../androidaps/database/AppRepository.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt b/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt index 8bd48a5b54..c074386d30 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt @@ -60,12 +60,12 @@ class AppRepository @Inject internal constructor( fun clearDatabases() = database.clearAllTables() //BG READINGS -- only valid records - fun compatGetBgReadingsDataFromTime(timestamp: Long, ascending: Boolean) = + fun compatGetBgReadingsDataFromTime(timestamp: Long, ascending: Boolean): Single> = database.glucoseValueDao.compatGetBgReadingsDataFromTime(timestamp) .map { if (!ascending) it.reversed() else it } .subscribeOn(Schedulers.io()) - fun compatGetBgReadingsDataFromTime(start: Long, end: Long, ascending: Boolean) = + fun compatGetBgReadingsDataFromTime(start: Long, end: Long, ascending: Boolean): Single> = database.glucoseValueDao.compatGetBgReadingsDataFromTime(start, end) .map { if (!ascending) it.reversed() else it } .subscribeOn(Schedulers.io()) @@ -74,23 +74,23 @@ class AppRepository @Inject internal constructor( fun findBgReadingByNSIdSingle(nsId: String): Single> = database.glucoseValueDao.findByNSIdMaybe(nsId).toWrappedSingle() - fun getModifiedBgReadingsDataFromId(lastId: Long) = + fun getModifiedBgReadingsDataFromId(lastId: Long): Single> = database.glucoseValueDao.getModifiedFrom(lastId) .subscribeOn(Schedulers.io()) - fun getBgReadingsCorrespondingLastHistoryRecord(lastId: Long) = + fun getBgReadingsCorrespondingLastHistoryRecord(lastId: Long): GlucoseValue? = database.glucoseValueDao.getLastHistoryRecord(lastId) @Suppress("unused") // debug purpose only - fun getAllBgReadingsStartingFrom(lastId: Long) = + fun getAllBgReadingsStartingFrom(lastId: Long): Single> = database.glucoseValueDao.getAllStartingFrom(lastId) .subscribeOn(Schedulers.io()) // TEMP TARGETS - fun compatGetTemporaryTargetData() = + fun compatGetTemporaryTargetData(): List = database.temporaryTargetDao.compatGetTemporaryTargetData() - fun compatGetTemporaryTargetDataFromTime(timestamp: Long, ascending: Boolean) = + fun compatGetTemporaryTargetDataFromTime(timestamp: Long, ascending: Boolean): Single> = database.temporaryTargetDao.compatGetTemporaryTargetDataFromTime(timestamp) .map { if (!ascending) it.reversed() else it } .subscribeOn(Schedulers.io()) @@ -98,11 +98,11 @@ class AppRepository @Inject internal constructor( fun findTemporaryTargetByNSIdSingle(nsId: String): Single> = database.temporaryTargetDao.findByNSIdMaybe(nsId).toWrappedSingle() - fun getModifiedTemporaryTargetsDataFromId(lastId: Long) = + fun getModifiedTemporaryTargetsDataFromId(lastId: Long): Single> = database.temporaryTargetDao.getModifiedFrom(lastId) .subscribeOn(Schedulers.io()) - fun getTemporaryTargetsCorrespondingLastHistoryRecord(lastId: Long) = + fun getTemporaryTargetsCorrespondingLastHistoryRecord(lastId: Long): TemporaryTarget? = database.temporaryTargetDao.getLastHistoryRecord(lastId) }