Package com.sensorberg.response

Types

Response
Link copied to clipboard
data class Response<TYPE, PROGRESS>(status: Response.Status, data: TYPE?, progress: PROGRESS?, exception: Throwable?)

A Generic data holder that contains both the data and the status of the process that generates the data.

Result
Link copied to clipboard
sealed class Result<out T>

Result of a type T.

SimpleResponse
Link copied to clipboard
typealias SimpleResponse<TYPE> = Response<TYPE, Void>

A simplification of the Response type that the Response.progress is Void and it's value is always 'null'

Functions

map
Link copied to clipboard
fun <I, O, P> Response<I, P>?.map(mapper: (I?) -> O?): Response<O, P>?

Maps the Response.data from one type to another. Keeps Response.status, Response.progress and Response.exception unchanged.