Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptionalObjectProperty should have better interface #13

Closed
tobiasdiez opened this issue May 15, 2020 · 1 comment
Closed

OptionalObjectProperty should have better interface #13

tobiasdiez opened this issue May 15, 2020 · 1 comment

Comments

@tobiasdiez
Copy link
Owner

setValue should accept T not Optional<T>.

@tobiasdiez
Copy link
Owner Author

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>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant