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

FetchResponse

class FetchResponse<FETCH_RESPONSE>

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

Properties

failure

val failure: Throwable?

response

val response: FETCH_RESPONSE?

Functions

isFailure

fun isFailure(): Boolean

isSuccessful

fun isSuccessful(): Boolean

Companion Object Functions

fail

fun <FETCH_RESPONSE> fail(throwable: Throwable): FetchResponse<FETCH_RESPONSE>

success

fun <FETCH_RESPONSE> success(response: FETCH_RESPONSE): FetchResponse<FETCH_RESPONSE>