OptionalObjectProperty should have better interface
tobiasdiez opened this issue · 1 comments
tobiasdiez commented
setValue should accept T not Optional<T>.
tobiasdiez commented
This will not be changed (at least for now). Reason: the contract for get is different in a binding and for an optional.
Optional.get will throw an exception if the optional was empty. We cannot do the same for OptionalBinding.get since this is used when binding properties. For this reason, OptionalBinding is a Binding of type Optional<T>, which results in get return an Optional<T>. Similarly, the set method then expects an Optional<T>.