Package org.teamapps.commons.databinding
Klasse DataBindings
java.lang.Object
org.teamapps.commons.databinding.DataBindings
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <T> voidbindOneWay(ObservableValue<T> observableValue, MutableValue<T> mutableValue) static <T> voidbindTwoWays(TwoWayBindableValue<T> bindable1, TwoWayBindableValue<T> bindable2) static <T> MutableValue<T>createMutableValue(Consumer<T> consumer) Creates aMutableValuefrom aConsumer.static <T> ObservableValue<T>createObservableValueFromEmptyEvent(Event<?> changeEvent, Supplier<T> valueSupplier) Creates anObservableValue, the value of which will always be determined by the givenvalueSupplier.static <T> ObservableValue<T>createObservableValueFromEvent(Event<T> event) Creates anObservableValuethat takes its value from the values emitted by the specifiedEvent.static <T> ObservableValue<T>createObservableValueFromEvent(Event<T> event, T initialValue) Creates anObservableValuethat takes its value from the values emitted by the specifiedEvent.
-
Konstruktordetails
-
DataBindings
public DataBindings()
-
-
Methodendetails
-
createObservableValueFromEmptyEvent
public static <T> ObservableValue<T> createObservableValueFromEmptyEvent(Event<?> changeEvent, Supplier<T> valueSupplier) Creates anObservableValue, the value of which will always be determined by the givenvalueSupplier. The givenEventwill be used only for triggering the onChange method, not for determining its value.- Typparameter:
T- type of value- Parameter:
changeEvent- Event that will trigger the onChange event.valueSupplier- Supplier for the value of the created ObservableValue.- Gibt zurück:
- the created ObservableValue
-
createObservableValueFromEvent
Creates anObservableValuethat takes its value from the values emitted by the specifiedEvent. These values will be cached. Note that initially, the cached value is going to benull.- Typparameter:
T- type of value- Parameter:
event- Event the values of the createdObservableValuewill be taken from.- Gibt zurück:
- the created ObservableValue
-
createObservableValueFromEvent
Creates anObservableValuethat takes its value from the values emitted by the specifiedEvent. These values will be cached.- Typparameter:
T- type of value- Parameter:
event- Event the values of the createdObservableValuewill be taken from.initialValue- The initial value (before the first occurrence ofevent).- Gibt zurück:
- the created ObservableValue
-
createMutableValue
Creates aMutableValuefrom aConsumer. Since both interfaces are virtually the same, this is a trivial operation.- Typparameter:
T- value type- Parameter:
consumer- the consumer.- Gibt zurück:
- the
MutableValue
-
bindOneWay
-
bindTwoWays
public static <T> void bindTwoWays(TwoWayBindableValue<T> bindable1, TwoWayBindableValue<T> bindable2)
-