net.corda.client.fxutils

## Class ObservableUtilitiesKt

- net.corda.client.fxutils.ObservableUtilitiesKt

-     public class ObservableUtilitiesKt

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,A,B> javafx.collections.ObservableMap<K,B>` | `associateBy(javafx.collections.ObservableList<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends K> toKey, kotlin.jvm.functions.Function2<? super K,? super A,? extends B> assemble)` data class Person(val height: Long) val people: ObservableList = (..) val nameToHeight: ObservableMap = people.associateBy(Person::name) { name, person -> person.height }
    `static <K,A> javafx.collections.ObservableMap<K,A>` | `associateBy(javafx.collections.ObservableList<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends K> toKey)` val people: ObservableList = (..) val nameToPerson: ObservableMap = people.associateBy(Person::name)
    `static <K,A,B> javafx.collections.ObservableMap<K,javafx.collections.ObservableList>` | `associateByAggregation(javafx.collections.ObservableList<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends K> toKey, kotlin.jvm.functions.Function2<? super K,? super A,? extends B> assemble)` val people: ObservableList = (..) val heightToNames: ObservableMap = people.associateByAggregation(Person::height) { name, person -> person.name }
    `static <K,A> javafx.collections.ObservableMap<K,javafx.collections.ObservableList>` | `associateByAggregation(javafx.collections.ObservableList<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends K> toKey)` val people: ObservableList = (..) val heightToPeople: ObservableMap = people.associateByAggregation(Person::height)
    `static <A,B> javafx.beans.value.ObservableValue<B>` | `bind(javafx.beans.value.ObservableValue<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends javafx.beans.value.ObservableValue<B>> function)` data class Person(val height: ObservableValue) val person: ObservableValue = (..) val personHeight: ObservableValue = person.bind { it.height }
    `static <A,B> javafx.beans.value.ObservableValue<? extends B>` | `bindOut(javafx.beans.value.ObservableValue<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends javafx.beans.value.ObservableValue<? extends B>> function)` A variant of bind that has out variance on the output type. This is sometimes useful when kotlin is too eager to propagate variance constraints and type inference fails.
    `static <A> javafx.collections.ObservableList<A>` | `concatenate(javafx.collections.ObservableList<javafx.collections.ObservableList> $receiver)` val groups: ObservableList = (..) val allPeople: ObservableList = groups.concatenate()
    `static <A> javafx.collections.ObservableList<A>` | `filter(javafx.collections.ObservableList<? extends A> $receiver, javafx.beans.value.ObservableValue<kotlin.jvm.functions.Function1> predicate)` enum class FilterCriterion { HEIGHT, NAME } val filterCriterion: ObservableValue = (..) val people: ObservableList = (..) fun filterFunction(filterCriterion: FilterCriterion): (Person) -> Boolean { .. }
    `static <A> javafx.collections.ObservableList<A>` | `filterNotNull(javafx.collections.ObservableList<? extends A> $receiver)` data class Dog(val owner: Person?) val dogs: ObservableList = (..) val owners: ObservableList = dogs.map(Dog::owner).filterNotNull()
    `static <A> javafx.beans.value.ObservableValue<A>` | `first(javafx.collections.ObservableList<A> $receiver)`
    `static <A> javafx.beans.value.ObservableValue<A>` | `firstOrDefault(javafx.collections.ObservableList<A> $receiver, javafx.beans.value.ObservableValue<A> p, kotlin.jvm.functions.Function1<? super A,java.lang.Boolean> predicate)` Return first element of the observable list as observable value. Return provided default value if the list is empty.
    `static <A> javafx.beans.value.ObservableValue<A>` | `firstOrNullObservable(javafx.collections.ObservableList<A> $receiver, kotlin.jvm.functions.Function1<? super A,java.lang.Boolean> predicate)` Return first element of the observable list as observable value. Return ObservableValue(null) if the list is empty.
    `static <A> javafx.collections.ObservableList<A>` | `flatten(javafx.collections.ObservableList<? extends javafx.beans.value.ObservableValue<? extends A>> $receiver)` data class Person(val height: ObservableValue) val people: ObservableList = (..) val heights: ObservableList = people.map(Person::height).flatten()
    `static <A,B> javafx.beans.value.ObservableValue<B>` | `foldObservable(javafx.collections.ObservableList<? extends A> $receiver, B initial, kotlin.jvm.functions.Function2<? super B,? super A,? extends B> folderFunction)` val people: ObservableList = (..) val concatenatedNames = people.foldObservable("", { names, person -> names + person.name }) val concatenatedNames2 = people.map(Person::name).fold("", String::plus)
    `static <K,V> javafx.collections.ObservableList<java.util.Map.Entry>` | `getObservableEntries(javafx.collections.ObservableMap<K,V> $receiver)` val nameToPerson: ObservableMap = (..) val people: ObservableList = nameToPerson.getObservableValues()
    `static <K,V> javafx.beans.value.ObservableValue<V>` | `getObservableValue(javafx.collections.ObservableMap<K,V> $receiver, K key)` val nameToPerson: ObservableMap = (..) val john: ObservableValue = nameToPerson.getObservableValue("John")
    `static <K,V> javafx.collections.ObservableList<V>` | `getObservableValues(javafx.collections.ObservableMap<K,V> $receiver)` val nameToPerson: ObservableMap = (..) val people: ObservableList = nameToPerson.getObservableValues()
    `static <A> javafx.beans.value.ObservableValue<A>` | `getValueAt(javafx.collections.ObservableList<A> $receiver, int index)`
    `static javafx.beans.binding.BooleanBinding` | `isNotNull(javafx.beans.value.ObservableValue<?> $receiver)`
    `static <A> javafx.beans.value.ObservableValue<A>` | `last(javafx.collections.ObservableList<A> $receiver)`
    `static <A,B,C,K> javafx.collections.ObservableList<C>` | `leftOuterJoin(javafx.collections.ObservableList<A> $receiver, javafx.collections.ObservableList<B> rightTable, kotlin.jvm.functions.Function1<? super A,? extends K> leftToJoinKey, kotlin.jvm.functions.Function1<? super B,? extends K> rightToJoinKey, kotlin.jvm.functions.Function2<? super A,? super javafx.collections.ObservableList<B>,? extends C> assemble)` data class Person(val name: String, val managerName: String) val people: ObservableList = (..) val managerEmployeeMapping: ObservableList> = people.leftOuterJoin(people, Person::name, Person::managerName) { manager, employees -> Pair(manager, employees) }
    `static <A,B,K> javafx.collections.ObservableMap<K,kotlin.Pair>` | `leftOuterJoin(javafx.collections.ObservableList<A> $receiver, javafx.collections.ObservableList<B> rightTable, kotlin.jvm.functions.Function1<? super A,? extends K> leftToJoinKey, kotlin.jvm.functions.Function1<? super B,? extends K> rightToJoinKey)` data class Person(name: String, favouriteSpecies: Species) data class Animal(name: String, species: Species) val people: ObservableList = (..) val animals: ObservableList = (..) val peopleToFavouriteAnimals: ObservableMap> = people.leftOuterJoin(animals, Person::favouriteSpecies, Animal::species)
    `static <A> javafx.beans.value.ObservableValue<A>` | `lift(A $receiver)` val aliceHeight: ObservableValue = (..) val bobHeight: ObservableValue = (..) fun sumHeight(a: Long, b: Long): Long { .. }
    `static <A,R> javafx.beans.value.ObservableValue<R>` | `lift(kotlin.jvm.functions.Function1<? super A,? extends R> $receiver, javafx.beans.value.ObservableValue<A> arg0)`
    `static <A,B,R> javafx.beans.value.ObservableValue<R>` | `lift(kotlin.jvm.functions.Function2<? super A,? super B,? extends R> $receiver, javafx.beans.value.ObservableValue<A> arg0, javafx.beans.value.ObservableValue<B> arg1)`
    `static <A,B,C,R> javafx.beans.value.ObservableValue<R>` | `lift(kotlin.jvm.functions.Function3<? super A,? super B,? super C,? extends R> $receiver, javafx.beans.value.ObservableValue<A> arg0, javafx.beans.value.ObservableValue<B> arg1, javafx.beans.value.ObservableValue<C> arg2)`
    `static <A,B,C,D,R> javafx.beans.value.ObservableValue<R>` | `lift(kotlin.jvm.functions.Function4<? super A,? super B,? super C,? super D,? extends R> $receiver, javafx.beans.value.ObservableValue<A> arg0, javafx.beans.value.ObservableValue<B> arg1, javafx.beans.value.ObservableValue<C> arg2, javafx.beans.value.ObservableValue<D> arg3)`
    `static <A,B> javafx.beans.value.ObservableValue<B>` | `map(javafx.beans.value.ObservableValue<? extends A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends B> function)` val person: ObservableValue = (..) val personName: ObservableValue = person.map { it.name }
    `static <A,B> javafx.collections.ObservableList<B>` | `map(javafx.collections.ObservableList<? extends A> $receiver, boolean cached, kotlin.jvm.functions.Function1<? super A,? extends B> function)` val dogs: ObservableList = (..) val dogOwners: ObservableList = dogs.map { it.owner }
    `static <A> javafx.collections.ObservableList<A>` | `sequence(java.util.Collection<? extends javafx.beans.value.ObservableValue<? extends A>> $receiver)` data class Person(val height: ObservableValue) val people: List = listOf(alice, bob) val heights: ObservableList = people.map(Person::height).sequence()
    `static <T> javafx.collections.ObservableList<T>` | `unique(javafx.collections.ObservableList<T> $receiver)`

- - ### Method Detail

    - #### map

          public static <A,B> javafx.beans.value.ObservableValue<B> map(javafx.beans.value.ObservableValue<? extends A> $receiver,
                                                                        kotlin.jvm.functions.Function1<? super A,? extends B> function)

      val person: ObservableValue = (..) val personName: ObservableValue = person.map { it.name }

    - #### map

          public static <A,B> javafx.collections.ObservableList<B> map(javafx.collections.ObservableList<? extends A> $receiver,
                                                                       boolean cached,
                                                                       kotlin.jvm.functions.Function1<? super A,? extends B> function)

      val dogs: ObservableList = (..) val dogOwners: ObservableList = dogs.map { it.owner }

      Parameters:
        `cached` - If true the results of the mapped function are cached in a backing list. If false each get() will re-run the function.

    - #### lift

          public static <A> javafx.beans.value.ObservableValue<A> lift(A $receiver)

      val aliceHeight: ObservableValue = (..) val bobHeight: ObservableValue = (..) fun sumHeight(a: Long, b: Long): Long { .. }

      val aliceBobSumHeight = ::sumHeight.lift(aliceHeight, bobHeight) val aliceHeightPlus2 = ::sumHeight.lift(aliceHeight, 2L.lift())

    - #### lift

          public static <A,R> javafx.beans.value.ObservableValue<R> lift(kotlin.jvm.functions.Function1<? super A,? extends R> $receiver,
                                                                         javafx.beans.value.ObservableValue<A> arg0)

    - #### lift

          public static <A,B,R> javafx.beans.value.ObservableValue<R> lift(kotlin.jvm.functions.Function2<? super A,? super B,? extends R> $receiver,
                                                                           javafx.beans.value.ObservableValue<A> arg0,
                                                                           javafx.beans.value.ObservableValue<B> arg1)

    - #### lift

          public static <A,B,C,R> javafx.beans.value.ObservableValue<R> lift(kotlin.jvm.functions.Function3<? super A,? super B,? super C,? extends R> $receiver,
                                                                             javafx.beans.value.ObservableValue<A> arg0,
                                                                             javafx.beans.value.ObservableValue<B> arg1,
                                                                             javafx.beans.value.ObservableValue<C> arg2)

    - #### lift

          public static <A,B,C,D,R> javafx.beans.value.ObservableValue<R> lift(kotlin.jvm.functions.Function4<? super A,? super B,? super C,? super D,? extends R> $receiver,
                                                                               javafx.beans.value.ObservableValue<A> arg0,
                                                                               javafx.beans.value.ObservableValue<B> arg1,
                                                                               javafx.beans.value.ObservableValue<C> arg2,
                                                                               javafx.beans.value.ObservableValue<D> arg3)

    - #### bind

          public static <A,B> javafx.beans.value.ObservableValue<B> bind(javafx.beans.value.ObservableValue<? extends A> $receiver,
                                                                         kotlin.jvm.functions.Function1<? super A,? extends javafx.beans.value.ObservableValue<B>> function)

      data class Person(val height: ObservableValue) val person: ObservableValue = (..) val personHeight: ObservableValue = person.bind { it.height }

    - #### bindOut

          public static <A,B> javafx.beans.value.ObservableValue<? extends B> bindOut(javafx.beans.value.ObservableValue<? extends A> $receiver,
                                                                                      kotlin.jvm.functions.Function1<? super A,? extends javafx.beans.value.ObservableValue<? extends B>> function)

      A variant of bind that has out variance on the output type. This is sometimes useful when kotlin is too eager to propagate variance constraints and type inference fails.

    - #### filter

          public static <A> javafx.collections.ObservableList<A> filter(javafx.collections.ObservableList<? extends A> $receiver,
                                                                        javafx.beans.value.ObservableValue<kotlin.jvm.functions.Function1> predicate)

      enum class FilterCriterion { HEIGHT, NAME } val filterCriterion: ObservableValue = (..) val people: ObservableList = (..) fun filterFunction(filterCriterion: FilterCriterion): (Person) -> Boolean { .. }

      val filteredPeople: ObservableList = people.filter(filterCriterion.map(filterFunction))

    - #### filterNotNull

          public static <A> javafx.collections.ObservableList<A> filterNotNull(javafx.collections.ObservableList<? extends A> $receiver)

      data class Dog(val owner: Person?) val dogs: ObservableList = (..) val owners: ObservableList = dogs.map(Dog::owner).filterNotNull()

    - #### foldObservable

          public static <A,B> javafx.beans.value.ObservableValue<B> foldObservable(javafx.collections.ObservableList<? extends A> $receiver,
                                                                                   B initial,
                                                                                   kotlin.jvm.functions.Function2<? super B,? super A,? extends B> folderFunction)

      val people: ObservableList = (..) val concatenatedNames = people.foldObservable("", { names, person -> names + person.name }) val concatenatedNames2 = people.map(Person::name).fold("", String::plus)

    - #### flatten

          public static <A> javafx.collections.ObservableList<A> flatten(javafx.collections.ObservableList<? extends javafx.beans.value.ObservableValue<? extends A>> $receiver)

      data class Person(val height: ObservableValue) val people: ObservableList = (..) val heights: ObservableList = people.map(Person::height).flatten()

    - #### sequence

          public static <A> javafx.collections.ObservableList<A> sequence(java.util.Collection<? extends javafx.beans.value.ObservableValue<? extends A>> $receiver)

      data class Person(val height: ObservableValue) val people: List = listOf(alice, bob) val heights: ObservableList = people.map(Person::height).sequence()

    - #### associateBy

          public static <K,A,B> javafx.collections.ObservableMap<K,B> associateBy(javafx.collections.ObservableList<? extends A> $receiver,
                                                                                  kotlin.jvm.functions.Function1<? super A,? extends K> toKey,
                                                                                  kotlin.jvm.functions.Function2<? super K,? super A,? extends B> assemble)

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

    - #### associateBy

          public static <K,A> javafx.collections.ObservableMap<K,A> associateBy(javafx.collections.ObservableList<? extends A> $receiver,
                                                                                kotlin.jvm.functions.Function1<? super A,? extends K> toKey)

      val people: ObservableList = (..) val nameToPerson: ObservableMap = people.associateBy(Person::name)

    - #### associateByAggregation

          public static <K,A,B> javafx.collections.ObservableMap<K,javafx.collections.ObservableList> associateByAggregation(javafx.collections.ObservableList<? extends A> $receiver,
                                                                                                                             kotlin.jvm.functions.Function1<? super A,? extends K> toKey,
                                                                                                                             kotlin.jvm.functions.Function2<? super K,? super A,? extends B> assemble)

      val people: ObservableList = (..) val heightToNames: ObservableMap = people.associateByAggregation(Person::height) { name, person -> person.name }

    - #### associateByAggregation

          public static <K,A> javafx.collections.ObservableMap<K,javafx.collections.ObservableList> associateByAggregation(javafx.collections.ObservableList<? extends A> $receiver,
                                                                                                                           kotlin.jvm.functions.Function1<? super A,? extends K> toKey)

      val people: ObservableList = (..) val heightToPeople: ObservableMap = people.associateByAggregation(Person::height)

    - #### getObservableValue

          public static <K,V> javafx.beans.value.ObservableValue<V> getObservableValue(javafx.collections.ObservableMap<K,V> $receiver,
                                                                                       K key)

      val nameToPerson: ObservableMap = (..) val john: ObservableValue = nameToPerson.getObservableValue("John")

    - #### getObservableValues

          public static <K,V> javafx.collections.ObservableList<V> getObservableValues(javafx.collections.ObservableMap<K,V> $receiver)

      val nameToPerson: ObservableMap = (..) val people: ObservableList = nameToPerson.getObservableValues()

    - #### getObservableEntries

          public static <K,V> javafx.collections.ObservableList<java.util.Map.Entry> getObservableEntries(javafx.collections.ObservableMap<K,V> $receiver)

      val nameToPerson: ObservableMap = (..) val people: ObservableList = nameToPerson.getObservableValues()

    - #### concatenate

          public static <A> javafx.collections.ObservableList<A> concatenate(javafx.collections.ObservableList<javafx.collections.ObservableList> $receiver)

      val groups: ObservableList = (..) val allPeople: ObservableList = groups.concatenate()

    - #### leftOuterJoin

          public static <A,B,C,K> javafx.collections.ObservableList<C> leftOuterJoin(javafx.collections.ObservableList<A> $receiver,
                                                                                     javafx.collections.ObservableList<B> rightTable,
                                                                                     kotlin.jvm.functions.Function1<? super A,? extends K> leftToJoinKey,
                                                                                     kotlin.jvm.functions.Function1<? super B,? extends K> rightToJoinKey,
                                                                                     kotlin.jvm.functions.Function2<? super A,? super javafx.collections.ObservableList<B>,? extends C> assemble)

      data class Person(val name: String, val managerName: String) val people: ObservableList = (..) val managerEmployeeMapping: ObservableList> = people.leftOuterJoin(people, Person::name, Person::managerName) { manager, employees -> Pair(manager, employees) }

    - #### leftOuterJoin

          public static <A,B,K> javafx.collections.ObservableMap<K,kotlin.Pair> leftOuterJoin(javafx.collections.ObservableList<A> $receiver,
                                                                                              javafx.collections.ObservableList<B> rightTable,
                                                                                              kotlin.jvm.functions.Function1<? super A,? extends K> leftToJoinKey,
                                                                                              kotlin.jvm.functions.Function1<? super B,? extends K> rightToJoinKey)

      data class Person(name: String, favouriteSpecies: Species) data class Animal(name: String, species: Species) val people: ObservableList = (..) val animals: ObservableList = (..) val peopleToFavouriteAnimals: ObservableMap> = people.leftOuterJoin(animals, Person::favouriteSpecies, Animal::species)

      This is the most general left join, given a joining key it returns for each key a pair of relevant elements from the left and right tables. It is "left outer" in the sense that all members of the left table are guaranteed to be in the result, but this may not be the case for the right table.

    - #### getValueAt

          public static <A> javafx.beans.value.ObservableValue<A> getValueAt(javafx.collections.ObservableList<A> $receiver,
                                                                             int index)

    - #### first

          public static <A> javafx.beans.value.ObservableValue<A> first(javafx.collections.ObservableList<A> $receiver)

    - #### last

          public static <A> javafx.beans.value.ObservableValue<A> last(javafx.collections.ObservableList<A> $receiver)

    - #### unique

          public static <T> javafx.collections.ObservableList<T> unique(javafx.collections.ObservableList<T> $receiver)

    - #### isNotNull

          public static javafx.beans.binding.BooleanBinding isNotNull(javafx.beans.value.ObservableValue<?> $receiver)

    - #### firstOrDefault

          public static <A> javafx.beans.value.ObservableValue<A> firstOrDefault(javafx.collections.ObservableList<A> $receiver,
                                                                                 javafx.beans.value.ObservableValue<A> p,
                                                                                 kotlin.jvm.functions.Function1<? super A,java.lang.Boolean> predicate)

      Return first element of the observable list as observable value. Return provided default value if the list is empty.

    - #### firstOrNullObservable

          public static <A> javafx.beans.value.ObservableValue<A> firstOrNullObservable(javafx.collections.ObservableList<A> $receiver,
                                                                                        kotlin.jvm.functions.Function1<? super A,java.lang.Boolean> predicate)

      Return first element of the observable list as observable value. Return ObservableValue(null) if the list is empty.