Skip to content

v2.0.0

Compare
Choose a tag to compare
@tobiasdiez tobiasdiez released this 16 Jul 23:27

Added

  • Added new interface EasyObservableList which is a wrapper around a standard ObservableList providing access to a few convenient helper methods. Use EasyBind.wrapList to create such a wrapper around a given ObservableList.
  • 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 standard Bindings.valueAt methods except that they gracefully handle non-existing values by returning a OptionalBinding.
  • Completely reworked bindings for optional values:
    • New methods in ObervableOptionalValue having Value in the name provide convenient access to the corresponding method of an optional. For example, getValueOrElse and isValuePresent are analogs of Optional.getOrElse and Optional.isPresent.
    • New methods that create bindings whose value is computed similar to the corresponding methods in Optional, e.g. isPresent, isEmpty, orElse, flatMap.

Changed

  • Renamed package to com.tobiasdiez.easybind.
  • Split MonadicBinding into a part which is really concerned with optionals (new ObervableOptionalValue) and one which provides helper methods for a fluent interface for normal bindings (new EasyBinding).
  • Renamed flatMap to mapObservable to avoid clashes with the corresponding method in Optional.
  • The mapObservable and selectProperty now invoke the mapper even if the source observable value holds a null value. The corresponding methods in ObservableOptionalValue allow for a more convenient null handling.
  • Renamed subscribe methods that accept listeners to listen, which invoke the given listener every time the value changes. In contrast, the subscribe method also invokes the given subscriber upon registration.
  • Renamed EasyBind.listBind to bindContent in order to align with the naming of Bindings.bindContent.
  • Moved PropertyBinding to com.tobiasdiez.easybind.

Removed

  • Removed EasyBind.filter(ObservableValue<T> source, Predicate<? super T> predicate). Use EasyBind.wrapNullable(source).filter(predicate) instead.
  • Removed EasyBind.orElse(ObservableValue<? extends T> source, T other). Use EasyBind.wrapNullable(source).orElse(other) instead.