Warning annotation

This commit is contained in:
InsanusMokrassar 2020-11-26 18:01:12 +06:00
parent b82c3864a0
commit 091bb1394f
4 changed files with 28 additions and 0 deletions

View File

@ -2,6 +2,8 @@
## 0.4.6 ## 0.4.6
* `Common`
* New annotation `Warning` has been added
* `Pagination` * `Pagination`
* `Common` * `Common`
* `Pagination` got new extension: `Pagination#isFirstPage` * `Pagination` got new extension: `Pagination#isFirstPage`

View File

@ -17,3 +17,21 @@ package dev.inmo.micro_utils.common
AnnotationTarget.TYPE_PARAMETER AnnotationTarget.TYPE_PARAMETER
) )
annotation class PreviewFeature annotation class PreviewFeature
@RequiresOptIn(
"This thing is marked as warned. See message of warn to get more info",
RequiresOptIn.Level.WARNING
)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.FIELD,
AnnotationTarget.PROPERTY,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER,
AnnotationTarget.FUNCTION,
AnnotationTarget.TYPE,
AnnotationTarget.TYPEALIAS,
AnnotationTarget.TYPE_PARAMETER
)
annotation class Warning(val message: String)

View File

@ -17,6 +17,11 @@ kotlin {
} }
} }
jvmMain {
dependencies {
api internalProject("micro_utils.common")
}
}
androidMain { androidMain {
dependencies { dependencies {
api "androidx.core:core-ktx:$core_ktx_version" api "androidx.core:core-ktx:$core_ktx_version"

View File

@ -1,5 +1,6 @@
package dev.inmo.micro_utils.repos package dev.inmo.micro_utils.repos
import dev.inmo.micro_utils.common.Warning
import dev.inmo.micro_utils.pagination.* import dev.inmo.micro_utils.pagination.*
import dev.inmo.micro_utils.pagination.utils.reverse import dev.inmo.micro_utils.pagination.utils.reverse
import kotlinx.coroutines.* import kotlinx.coroutines.*
@ -81,6 +82,7 @@ class FileReadStandardKeyValueRepo(
/** /**
* Files watching will not correctly works on Android with version of API lower than API 26 * Files watching will not correctly works on Android with version of API lower than API 26
*/ */
@Warning("Files watching will not correctly works on Android Platform with version of API lower than API 26")
class FileWriteStandardKeyValueRepo( class FileWriteStandardKeyValueRepo(
private val folder: File, private val folder: File,
filesChangedProcessingScope: CoroutineScope? = null filesChangedProcessingScope: CoroutineScope? = null
@ -160,6 +162,7 @@ class FileWriteStandardKeyValueRepo(
} }
} }
@Warning("Files watching will not correctly works on Android Platform with version of API lower than API 26")
class FileStandardKeyValueRepo( class FileStandardKeyValueRepo(
folder: File, folder: File,
filesChangedProcessingScope: CoroutineScope? = null filesChangedProcessingScope: CoroutineScope? = null