Documentation / dataflow-async / com.femastudios.dataflow.async / Attribute / of
Go to reference

of

@JvmStatic fun <T> of(value: T): Attribute<T>

Returns a new Attribute of type T whose state is always Loaded with a value of value


@JvmStatic fun <T> of(data: AttributeData<T>): Attribute<T>

Returns a new Attribute of type T whose state is always data

See Also

AttributeData


@JvmStatic fun <T> of(task: WorkContext.() -> T): RecomputableAttribute<T>

Returns a new lazy RecomputableAttribute with the associated task.

See Also

WorkContext


@JvmStatic fun <T> of(lazy: Boolean, task: WorkContext.() -> T): RecomputableAttribute<T>

Returns a new RecomputableAttribute with the associated task.

Parameters

lazy - when lazy the attributes starts calculating only when firstly accessed.

See Also

WorkContext


@JvmStatic fun <T> of(flowStrategy: FlowStrategy, task: WorkContext.() -> T): RecomputableAttribute<T>

Returns a new RecomputableAttribute with the associated task.

Parameters

flowStrategy - the FlowStrategy to use

See Also

WorkContext


@JvmStatic fun <T> of(lazy: Boolean = true, flowStrategy: FlowStrategy = FlowStrategy.CONSISTENT, task: WorkContext.() -> T): RecomputableAttribute<T>

Returns a new RecomputableAttribute with the associated task.

Parameters

lazy - when lazy the attributes starts calculating only when firstly accessed.

flowStrategy - the FlowStrategy to use

See Also

WorkContext