open class OnlineCacheState<CACHE>
Holds the current state of response that is obtained via a network call. This response structure is meant to be passed out of Teller and to the application using Teller so it can parse it and display the response representation in the app. The online response state is not manipulated here. It is only stored. Data in apps are in 1 of 3 different types of state:
object Testing
Used for testing purposes to create instances of OnlineCacheState. |
val cacheData: CACHE? |
|
val errorDuringFetch: Throwable? |
|
val errorDuringFirstFetch: Throwable? |
|
val fetchingForFirstTime: Boolean |
|
val isFetchingFreshData: Boolean |
|
val justCompletedSuccessfulFirstFetch: Boolean |
|
val justCompletedSuccessfullyFetchingFreshData: Boolean |
|
val lastTimeFetched: Date? |
|
val noCacheExists: Boolean |
|
val requirements: GetCacheRequirements? |
fun deliverAllStates(listener: OnlineCacheStateListener<CACHE>): Unit
Receive the full status of the response. |
|
fun deliverCacheState(listener: OnlineCacheStateCacheListener<CACHE>): Unit
This is usually used in the UI of an app to display the cached response to a user. |
|
fun deliverFetchingFreshCacheState(listener: OnlineCacheStateFetchingListener): Unit
This is usually used in the UI of an app to display the status of loading the response type for the first time to a user. |
|
fun deliverNoCacheState(listener: OnlineCacheStateNoCacheStateListener): Unit
This is usually used in the UI of an app to display that the cached response on the device is empty to a user. |
|
open fun equals(other: Any?): Boolean |
|
open fun hashCode(): Int |
|
open fun toString(): String |