attr

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

Sets an attribute.

Parameters

name

to use

value

to use


open fun attr(name: String, value: String?)

Sets an attribute only if its value is not null.

Parameters

name

to use

value

to use


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

Sets an attribute only for all none null values of the flow.

Parameters

name

to use

value

to use


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

Sets an attribute when value is true otherwise removes it.

Parameters

name

to use

value

for decision

trueValue

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