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

Package com.femastudios.dataflow.async.util

Extensions for External Classes

com.femastudios.dataflow.Field

com.femastudios.dataflow.listen.LifecycleOwner

Functions

asAttribute

Creates a new TimeShiftedAttribute using this as the field that contains the data.

fun <T> TimeShiftedField<AttributeData<T>>.asAttribute(): TimeShiftedAttribute<T>

attributeOf

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

fun <T> attributeOf(value: T): Attribute<T>

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

fun <T> attributeOf(data: AttributeData<T>): Attribute<T>

Returns a new RecomputableAttribute with the associated task.

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

attributeOfNull

Returns a new Attribute of type Nothing? whose value is always null

fun attributeOfNull(): Attribute<Nothing?>

attributeWrapperOf

Returns an AttributeWrapper initially containing the Loading state

fun <T> attributeWrapperOf(): AttributeWrapper<T>

Returns an AttributeWrapper initially containing the Loaded state with value loadedValue

fun <T> attributeWrapperOf(loadedValue: T): AttributeWrapper<T>

Returns an AttributeWrapper initially containing the given value state

fun <T> attributeWrapperOf(value: AttributeData<T>): AttributeWrapper<T>

Returns an AttributeWrapper initially containing the Loaded state with value mirroring the given loadedValue field

fun <T> attributeWrapperOf(loadedValue: Field<T>): AttributeWrapper<T>

Returns an AttributeWrapper initially mirroring the state of the given value attribute

fun <T> attributeWrapperOf(value: Attribute<T>): AttributeWrapper<T>

attributeWrapperOfNull

Returns an AttributeWrapper initially containing the Loaded state with value null

fun <T> attributeWrapperOfNull(): AttributeWrapper<T?>

coalesce

Returns an Attribute whose value is the first not null value from the given attributes.

fun <T> coalesce(vararg attributes: Attribute<T>): Attribute<T>

Returns an Attribute whose value is the first not null value from the given attributes list.

fun <T> coalesce(attributes: List<Attribute<T>>): Attribute<T>

then

fun <I, O> then(f1: Attribute<I>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I) -> Attribute<O>): RecomputableAttribute<O>

Returns an Attribute whose value mirrors the Attribute returned by transformer.

fun <I1, I2, O> then(f1: Attribute<I1>, f2: Attribute<I2>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, I9, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, f9: Attribute<I9>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8, I9) -> Attribute<O>): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, O> then(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, f9: Attribute<I9>, f10: Attribute<I10>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8, I9, I10) -> Attribute<O>): RecomputableAttribute<O>
fun <I, O> then(attributes: List<Attribute<I>>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(List<I>) -> Attribute<O>): RecomputableAttribute<O>
fun <I, O> then(attributes: Array<Attribute<I>>, flowStrategy: FlowStrategy = THEN_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(List<I>) -> Attribute<O>): RecomputableAttribute<O>

transform

fun <I, O> transform(f1: Attribute<I>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I) -> O): RecomputableAttribute<O>

Returns an Attribute whose value is the value of the given attributes, transformed according to the given transformer.

fun <I1, I2, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, I9, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, f9: Attribute<I9>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8, I9) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, O> transform(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, f9: Attribute<I9>, f10: Attribute<I10>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8, I9, I10) -> O): RecomputableAttribute<O>
fun <I, O> transform(attributes: List<Attribute<I>>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(List<I>) -> O): RecomputableAttribute<O>
fun <I, O> transform(attributes: Array<Attribute<I>>, flowStrategy: FlowStrategy = TRANSFORM_DEFAULT_FLOW_STRATEGY, transformer: WorkContext.(List<I>) -> O): RecomputableAttribute<O>

transformSync

fun <I, O> transformSync(f1: Attribute<I>, transformer: WorkContext.(I) -> O): RecomputableAttribute<O>

Returns an Attribute whose value is the value of the given attributes, transformed according to the given transformer.

fun <I1, I2, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, transformer: WorkContext.(I1, I2) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, transformer: WorkContext.(I1, I2, I3) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, transformer: WorkContext.(I1, I2, I3, I4) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, transformer: WorkContext.(I1, I2, I3, I4, I5) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, transformer: WorkContext.(I1, I2, I3, I4, I5, I6) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, I9, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, f9: Attribute<I9>, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8, I9) -> O): RecomputableAttribute<O>
fun <I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, O> transformSync(f1: Attribute<I1>, f2: Attribute<I2>, f3: Attribute<I3>, f4: Attribute<I4>, f5: Attribute<I5>, f6: Attribute<I6>, f7: Attribute<I7>, f8: Attribute<I8>, f9: Attribute<I9>, f10: Attribute<I10>, transformer: WorkContext.(I1, I2, I3, I4, I5, I6, I7, I8, I9, I10) -> O): RecomputableAttribute<O>
fun <I, O> transformSync(attributes: List<Attribute<I>>, transformer: WorkContext.(List<I>) -> O): RecomputableAttribute<O>
fun <I, O> transformSync(attributes: Array<Attribute<I>>, transformer: WorkContext.(List<I>) -> O): RecomputableAttribute<O>

tuple

Creates a Field of Pair, given two separate attributes.

fun <A, B> tuple(first: Attribute<A>, second: Attribute<B>): Attribute<Pair<A, B>>

Creates a Field of Triple, given three separate attributes.

fun <A, B, C> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>): Attribute<Triple<A, B, C>>

Creates a Field of Quadruple, given four separate attributes.

fun <A, B, C, D> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>): Attribute<Quadruple<A, B, C, D>>

Creates a Field of Quintuple, given five separate attributes.

fun <A, B, C, D, E> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>, fifth: Attribute<E>): Attribute<Quintuple<A, B, C, D, E>>

Creates a Field of Sixfold, given six separate attributes.

fun <A, B, C, D, E, F> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>, fifth: Attribute<E>, sixth: Attribute<F>): Attribute<Sixfold<A, B, C, D, E, F>>

Creates a Field of Sevenfold, given seven separate attributes.

fun <A, B, C, D, E, F, G> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>, fifth: Attribute<E>, sixth: Attribute<F>, seventh: Attribute<G>): Attribute<Sevenfold<A, B, C, D, E, F, G>>

Creates a Field of Eightfold, given eight separate attributes.

fun <A, B, C, D, E, F, G, H> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>, fifth: Attribute<E>, sixth: Attribute<F>, seventh: Attribute<G>, eighth: Attribute<H>): Attribute<Eightfold<A, B, C, D, E, F, G, H>>

Creates a Field of Ninefold, given nine separate attributes.

fun <A, B, C, D, E, F, G, H, I> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>, fifth: Attribute<E>, sixth: Attribute<F>, seventh: Attribute<G>, eighth: Attribute<H>, ninth: Attribute<I>): Attribute<Ninefold<A, B, C, D, E, F, G, H, I>>

Creates a Field of Tenfold, given ten separate attributes.

fun <A, B, C, D, E, F, G, H, I, J> tuple(first: Attribute<A>, second: Attribute<B>, third: Attribute<C>, fourth: Attribute<D>, fifth: Attribute<E>, sixth: Attribute<F>, seventh: Attribute<G>, eighth: Attribute<H>, ninth: Attribute<I>, tenth: Attribute<J>): Attribute<Tenfold<A, B, C, D, E, F, G, H, I, J>>