v2.0.0
Added
- Added new interface
EasyObservableList
which is a wrapper around a standardObservableList
providing access to a few convenient helper methods. UseEasyBind.wrapList
to create such a wrapper around a givenObservableList
. - Added new method
EasyBind.reduce(list, accumulation)
that creates a binding holding the result of the accumulation function on the provided list. - Added a few new methods
EasyBind.valueAt
that are essentially equivalent to the standardBindings.valueAt
methods except that they gracefully handle non-existing values by returning aOptionalBinding
. - Completely reworked bindings for optional values:
- New methods in
ObervableOptionalValue
havingValue
in the name provide convenient access to the corresponding method of an optional. For example,getValueOrElse
andisValuePresent
are analogs ofOptional.getOrElse
andOptional.isPresent
. - New methods that create bindings whose value is computed similar to the corresponding methods in
Optional
, e.g.isPresent
,isEmpty
,orElse
,flatMap
.
- New methods in
Changed
- Renamed package to
com.tobiasdiez.easybind
. - Split
MonadicBinding
into a part which is really concerned with optionals (newObervableOptionalValue
) and one which provides helper methods for a fluent interface for normal bindings (newEasyBinding
). - Renamed
flatMap
tomapObservable
to avoid clashes with the corresponding method inOptional
. - The
mapObservable
andselectProperty
now invoke the mapper even if the source observable value holds anull
value. The corresponding methods inObservableOptionalValue
allow for a more convenientnull
handling. - Renamed subscribe methods that accept listeners to
listen
, which invoke the given listener every time the value changes. In contrast, thesubscribe
method also invokes the given subscriber upon registration. - Renamed
EasyBind.listBind
tobindContent
in order to align with the naming ofBindings.bindContent
. - Moved
PropertyBinding
tocom.tobiasdiez.easybind
.
Removed
- Removed
EasyBind.filter(ObservableValue<T> source, Predicate<? super T> predicate)
. UseEasyBind.wrapNullable(source).filter(predicate)
instead. - Removed
EasyBind.orElse(ObservableValue<? extends T> source, T other)
. UseEasyBind.wrapNullable(source).orElse(other)
instead.