corda / net.corda.client.jfx.utils / javafx.collections.ObservableList / associateBy

# associateBy

`fun <K, A, B> ObservableList<out A>.associateBy(toKey: (A) -> K, assemble: (K, A) -> B): ObservableMap<K, B>`

data class Person(val height: Long) val people: ObservableList = (..) val nameToHeight: ObservableMap<String, Long> = people.associateBy(Person::name) { name, person -> person.height }

`fun <K, A> ObservableList<out A>.associateBy(toKey: (A) -> K): ObservableMap<K, A>`

val people: ObservableList = (..) val nameToPerson: ObservableMap<String, Person> = people.associateBy(Person::name)