attr

fun attr(name: String, value: String)
fun attr(name: String, value: Flow<String>)
fun <T> attr(name: String, value: T)
fun <T> attr(name: String, value: Flow<T>)

Sets an attribute.

Parameters

name

to use

value

to use

fun attr(name: String, value: Boolean, trueValue: String = "")
fun attr(name: String, value: Flow<Boolean>, trueValue: String = "")

Sets an attribute when value is true other removes it.

Parameters

name

to use

value

for decision

trueValue

value to use if attribute is set (default "")

fun attr(name: String, values: List<String>, separator: String = " ")
fun attr(name: String, values: Flow<List<String>>, separator: String = " ")

Sets an attribute from a List of Strings. Therefore it concatenates the Strings to the final value String.

Parameters

name

to use

values

for concatenation

separator

String for separation

fun attr(name: String, values: Map<String, Boolean>, separator: String = " ")
fun attr(name: String, values: Flow<Map<String, Boolean>>, separator: String = " ")

Sets an attribute from a Map of Strings and Booleans. The key inside the Map getting only set when the corresponding value is true. Otherwise they get removed from the resulting String.

Parameters

name

to use

values

to use

separator

String for separation