diff --git a/core/pagination/src/main/java/com/tangem/pagination/Batch.kt b/core/pagination/src/main/java/com/tangem/pagination/Batch.kt index b4b2482eaa..0e262776a2 100644 --- a/core/pagination/src/main/java/com/tangem/pagination/Batch.kt +++ b/core/pagination/src/main/java/com/tangem/pagination/Batch.kt @@ -4,10 +4,10 @@ package com.tangem.pagination * Represents a batch of data with a key. * Used in [BatchListState]. * - * @param K type of the key. - * @param T type of the data. + * @param TKey type of the key. + * @param TData type of the data. */ -data class Batch( - val key: K, - val data: T, +data class Batch( + val key: TKey, + val data: TData, ) \ No newline at end of file diff --git a/core/pagination/src/main/java/com/tangem/pagination/BatchAction.kt b/core/pagination/src/main/java/com/tangem/pagination/BatchAction.kt index 710e191dd7..4a4cfd7d71 100644 --- a/core/pagination/src/main/java/com/tangem/pagination/BatchAction.kt +++ b/core/pagination/src/main/java/com/tangem/pagination/BatchAction.kt @@ -3,11 +3,11 @@ package com.tangem.pagination /** * Action that can be dispatched to [BatchListSource]. * - * @param R type of the request to load batches. - * @param K type of the key of the batch. - * @param U type of the update request. + * @param TRequest type of the request to load batches. + * @param TKey type of the key of the batch. + * @param TUpdate type of the update request. */ -sealed class BatchAction { +sealed class BatchAction { /** * Action to load the first batch. diff --git a/core/pagination/src/main/java/com/tangem/pagination/BatchFetchResult.kt b/core/pagination/src/main/java/com/tangem/pagination/BatchFetchResult.kt index d4ea1d4ae7..03f87be764 100644 --- a/core/pagination/src/main/java/com/tangem/pagination/BatchFetchResult.kt +++ b/core/pagination/src/main/java/com/tangem/pagination/BatchFetchResult.kt @@ -4,10 +4,10 @@ package com.tangem.pagination * Represents a result of a batch fetch request. * Used in [BatchListState]. * - * @param T type of the data. - * @param E type of the error. + * @param TData type of the data. + * @param TError type of the error. */ -sealed class BatchFetchResult { +sealed class BatchFetchResult { /** * Represents a successful result of a batch fetch request. @@ -15,17 +15,17 @@ sealed class BatchFetchResult { * @param data fetched data. * @param last indicates if this is the last batch for the request. */ - data class Success( - val data: T, + data class Success( + val data: TData, val last: Boolean = false, - ) : BatchFetchResult() + ) : BatchFetchResult() /** * Represents an error result of a batch fetch request. * * @param error error that occurred during the request. */ - data class Error(val error: E) : BatchFetchResult() + data class Error(val error: TError) : BatchFetchResult() /** * Represents an unknown error result of a batch fetch request. diff --git a/core/pagination/src/main/java/com/tangem/pagination/BatchListState.kt b/core/pagination/src/main/java/com/tangem/pagination/BatchListState.kt index adce142dab..525458362f 100644 --- a/core/pagination/src/main/java/com/tangem/pagination/BatchListState.kt +++ b/core/pagination/src/main/java/com/tangem/pagination/BatchListState.kt @@ -3,16 +3,16 @@ package com.tangem.pagination /** * State that is used for listening the current state of a pagination. * - * @param K type of the key of the batch. - * @param T type of the data. - * @param E type of the error. + * @param TKey type of the key of the batch. + * @param TData type of the data. + * @param TError type of the error. * * @property data list of loaded batches. * @property status current status of the pagination. * * @see BatchListSource */ -data class BatchListState( - val data: List>, - val status: PaginationStatus, +data class BatchListState( + val data: List>, + val status: PaginationStatus, ) \ No newline at end of file diff --git a/core/pagination/src/main/java/com/tangem/pagination/BatchRequest.kt b/core/pagination/src/main/java/com/tangem/pagination/BatchRequest.kt index 6710c62702..b6c9545527 100644 --- a/core/pagination/src/main/java/com/tangem/pagination/BatchRequest.kt +++ b/core/pagination/src/main/java/com/tangem/pagination/BatchRequest.kt @@ -3,7 +3,7 @@ package com.tangem.pagination /** * Request to fetch a batch of data. * - * @param R type of the request. + * @param TRequest type of the request. * * @property offset offset for the request. * @property limit limit for the request. @@ -11,8 +11,8 @@ package com.tangem.pagination * * @see BatchFetcher */ -data class BatchRequest( +data class BatchRequest( val offset: Int, val limit: Int, - val data: R, + val data: TRequest, ) \ No newline at end of file diff --git a/core/pagination/src/main/java/com/tangem/pagination/BatchingContext.kt b/core/pagination/src/main/java/com/tangem/pagination/BatchingContext.kt index 95f10045c4..37b6bd2c73 100644 --- a/core/pagination/src/main/java/com/tangem/pagination/BatchingContext.kt +++ b/core/pagination/src/main/java/com/tangem/pagination/BatchingContext.kt @@ -6,9 +6,9 @@ import kotlinx.coroutines.flow.Flow /** * Context for working with [BatchListSource]. * - * @param R type of the request. - * @param K type of the key. - * @param U type of the update request. + * @param TRequest type of the request. + * @param TKey type of the key. + * @param TUpdate type of the update request. * * @property actionsFlow flow of [BatchAction]s that would be dispatched to [BatchListSource]. * @property coroutineScope scope for the [BatchListSource] to launch coroutines. When it is cancelled, @@ -16,7 +16,7 @@ import kotlinx.coroutines.flow.Flow * * @see BatchListSource */ -class BatchingContext( - val actionsFlow: Flow>, +class BatchingContext( + val actionsFlow: Flow>, val coroutineScope: CoroutineScope, ) \ No newline at end of file