mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-04 23:59:29 +00:00
all deprecations were removed
This commit is contained in:
@@ -5,26 +5,6 @@ import dev.inmo.micro_utils.pagination.utils.doForAllWithNextPaging
|
||||
import dev.inmo.micro_utils.pagination.utils.getAllWithNextPaging
|
||||
import dev.inmo.micro_utils.repos.ReadStandardCRUDRepo
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy. Can be replaced with other doForAll extensions")
|
||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>,
|
||||
crossinline block: (List<T>) -> Unit
|
||||
) {
|
||||
doForAllWithNextPaging {
|
||||
methodCaller(it).also {
|
||||
block(it.results)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy. Can be replaced with other doForAll extensions")
|
||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
||||
crossinline block: (List<T>) -> Unit
|
||||
) = doForAllWithNextPaging {
|
||||
getByPagination(it).also { block(it.results) }
|
||||
}
|
||||
|
||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.getAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>
|
||||
|
@@ -4,24 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
||||
import dev.inmo.micro_utils.pagination.utils.getAllWithNextPaging
|
||||
import dev.inmo.micro_utils.repos.ReadStandardKeyValueRepo
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
||||
block: (List<Pair<Key, Value>>) -> Unit
|
||||
) {
|
||||
doWithPagination {
|
||||
methodCaller(it).also { keys ->
|
||||
block(keys.results.mapNotNull { key -> get(key) ?.let { value -> key to value } })
|
||||
}.nextPageIfNotEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
block: (List<Pair<Key, Value>>) -> Unit
|
||||
) = doForAll({ keys(it, false) }, block)
|
||||
|
||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.getAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
||||
|
@@ -4,34 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
||||
import dev.inmo.micro_utils.pagination.utils.getAllWithNextPaging
|
||||
import dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
||||
block: (List<Pair<Key, List<Value>>>) -> Unit
|
||||
) {
|
||||
doWithPagination {
|
||||
methodCaller(it).also { keys ->
|
||||
block(
|
||||
keys.results.mapNotNull { key ->
|
||||
val values = mutableListOf<Value>()
|
||||
doWithPagination {
|
||||
get(key, it).also {
|
||||
values.addAll(it.results)
|
||||
}.nextPageIfNotEmpty()
|
||||
}
|
||||
key to values
|
||||
}
|
||||
)
|
||||
}.nextPageIfNotEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
block: (List<Pair<Key, List<Value>>>) -> Unit
|
||||
) = doForAll({ keys(it, false) }, block)
|
||||
|
||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.getAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
||||
|
Reference in New Issue
Block a user