【发布时间】:2019-03-13 18:11:53
【问题描述】:
我有两个 Flux 对象,例如:
Flux<Item> 和 Flux<Transformation>
data class Item(val value: Int)
data class Transformation(val type: String, val value: Int)
我想对每个项目应用所有转换 - 例如:
var item = Item(15)
val transformations = listOf(Transformation(type = "MULTIPLY", value = 8), ...)
transformations.forEach {
if (it.type == "MULTIPLY") {
item = Item(item.value * it.value)
}
}
但是当有Flux'es 的Item 和Transformation 时
【问题讨论】: