ComputedValue
Computed value for values of type T.
Computed values should depend on other values. These dependencies may be defined via the dependency function, by providing the path of the dependency relative to the value being computed.
Example computed value which computes the sum between two other values:
object MySum : ComputedValue<Int>() {
private val ComputedValueContext.value1: Int? by dependency("../value1")
private val ComputedValueContext.value2: Int? by dependency("../value2")
override suspend fun ComputedValueContext.compute(): Int = (value1 ?: 0) + (value2 ?: 0)
}Inheritors
Properties
Dependencies of the computed value. Mapping of keys to the paths this computed value depends on. Keys can be used within a ComputedValueContext to access the value of the dependencies.
Set of external context dependencies of the computed value.
Schema of the value being computed.
Functions
Declares a dependency to path, accessible in the computed value's context via key dependencyKey.
Declares an external context dependency to externalContextName.
Runs the computation within a ComputedValueContext containing the value of all declared dependencies. Returns the computed value.
Function used to declare a dependency to a path and delegate access to its value within a ComputedValueContext.
Function used to declare a dependency to a path and delegate access to its value within a ComputedValueContext.
Function used to declare a dependency to an external context and delegate access to its value within a ComputedValueContext.
Function used to declare a dependency to an external context and delegate access to its value within a ComputedValueContext.