public static class SwitchBindings.SwitchBuilder<T,R> extends Object
| Modifier and Type | Method and Description |
|---|---|
SwitchBindings.SwitchBuilder<T,R> |
bindCase(T value,
Callback<T,R> callback)
This builder method is used to define a callback that is used when the base observable has the given value.
|
SwitchBindings.SwitchBuilder<T,R> |
bindDefault(Supplier<R> consumer)
This builder method is used to define a consumer that is used when no case is defined for the actual value of the base observable.
|
ObservableValue<R> |
build()
the build-step of the builder.
|
public SwitchBindings.SwitchBuilder<T,R> bindCase(T value, Callback<T,R> callback)
This builder method is used to define a callback that is used when the base observable has the given value.
This is the equivalent to the “case” in a java switch statement.
value - the value for this case statement.callback - a callback that is executed when this case statement matches the actual value of the base observable.public SwitchBindings.SwitchBuilder<T,R> bindDefault(Supplier<R> consumer)
This builder method is used to define a consumer that is used when no case is defined for the actual value of the base observable.
This is the equivalent to the “default” case in a java switch statement.
consumer - a consumer that is used to get the default value.public ObservableValue<R> build()
the build-step of the builder. This creates the actual observable binding.