Documentation / dataflow-async / com.femastudios.dataflow.async / NotLoaded
Go to reference

NotLoaded

sealed class NotLoaded<out T> : AttributeData<T>

This class is one of the extensions of AttributeData and is used to represent any state that is not loaded. This is also a sealed class and cannot be directly instantiated. The only two descendants are Error and Loading.

Functions

asField

Returns a constant Field that contains this AttributeData

open fun asField(): Field<NotLoaded<T>>

cast

Performs a cast to a different type parameter, which is necessary to propagate a status between attributes of different type. For performance reasons it's better to cast the error rather than creating a new instance, and since most of the time the statuses extending NotLoaded do not make use of the type parameter T, it can be safely done.

abstract fun <O> cast(): NotLoaded<O>

Inheritors

Error

This class is one of the extensions of the NotLoaded status, and is used to represent a data whose loading di not succeed. It contains some data that can help inform the user. The class is open and can be extended to add custom data.

open class Error<out T> : NotLoaded<T>

Loading

This class is one of the extensions of the NotLoaded status, and is used to represent a data that is loading. The class is open and can be extended to add custom data.

open class Loading<out T> : NotLoaded<T>