teller / com.levibostian.teller.repository / OnlineRepository / FetchResponse

FetchResponse

class FetchResponse<FETCH_RESPONSE : Any>

When a OnlineRepository.fetchFreshData task is performed, Teller needs to know if the fetch request is considered to be a success or a failure.

Exceptions

ResponseFail

class ResponseFail : Throwable

Properties

data

val data: FETCH_RESPONSE?

failure

val failure: Throwable?

Functions

isFailure

fun isFailure(): Boolean

isSuccessful

fun isSuccessful(): Boolean

Companion Object Functions

fail

fun <FETCH_RESPONSE : Any> fail(message: String): FetchResponse<FETCH_RESPONSE>
fun <FETCH_RESPONSE : Any> fail(throwable: Throwable): FetchResponse<FETCH_RESPONSE>

success

fun <FETCH_RESPONSE : Any> success(data: FETCH_RESPONSE): FetchResponse<FETCH_RESPONSE>