Documentation / dataflow-async / com.femastudios.dataflow.async.extensions / getOrElse
Go to reference
Go to reference
getOrElse
fun <T> Attribute<List<T>>.getOrElse(index: Attribute<Int>, defaultValue: (Int) -> T): Attribute<T>
fun <T> Attribute<List<T>>.getOrElse(index: Int, defaultValue: (Int) -> T): Attribute<T>
fun <K, V> Attribute<Map<K, V>>.getOrElse(key: K, defaultValue: () -> V): Attribute<V>
fun <K, V> Attribute<Map<K, V>>.getOrElse(key: Attribute<K>, defaultValue: () -> V): Attribute<V>
Same as getOrElse, but accepts Attribute and returns a new Attribute.
Calling this function is equivalent to use transform and calling getOrElse in the transformation function.
This is simply a convenience function.
See Also
fun Attribute<String>.getOrElse(index: Attribute<Int>, defaultValue: (Int) -> Char): Attribute<Char>
fun Attribute<String>.getOrElse(index: Int, defaultValue: (Int) -> Char): Attribute<Char>
Same as getOrElse, but accepts Attribute and returns a new Attribute.
Calling this function is equivalent to use transform and calling getOrElse in the transformation function.
This is simply a convenience function.
See Also