How can I get a specific property of an object using filter in Kotlin?
In Kotlin I have the following objects:
data class BugReport(
val message: String,
val bugItems: List,
)
And:
data class BugItem(
val title: String,
val checked: Boolean = false,
)
In a BugReport object, how can I get only the title property of those BugItems whose checked value is equal to true.
The idea is to get a comma separated string from the title.
I have this code:
val checkedTitles = bugReport.bugItems.filter(BugItem::checked).joinToString()
But with this code I...