antoniomarin
04/02/2021, 10:24 AMobject1: TestType = [
object2=[
(...)
random = ...,
stringList = ["1", "2", "3"]
],
object2(),
object2(),
(....)
]
Something like this should work, but I'm wondering is there a more elegant solution? I'm sure there is š I guess I could do a object2Mapper
which could filter "3" as well.
fun TestType.getWithout3(): TestType {
val returnObject = object1
returnObject.forEach { object1 ->
object1.object2.forEach { object2 ->
object2.stringList.toMutableList.removeAll { item == "3"}
}
}
return returnObject
}
mappers
and doing this logic while transforming objects. Not sure is there a better or more performant solution š¤·