-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: Use binding object to check for Binder#hasChanges #17861
feat: Use binding object to check for Binder#hasChanges #17861
Conversation
Bindings. Overloads the existing Binder#hasChanges method. GH issue vaadin#17395
|
@benedikt-roth do you mind signing the CLA and formatting the source code as suggested in #17861 (comment)? |
Sure, done that and also fixed the formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, the change looks good.
I would add tests for hasChanges
when the binding has been removed from the binder.
I also wonder if we could add the hasChanges()
method also on the Binding
interface, so that it would be possible to simply do a binding.hasChanges()
.
The implementation in BindingImpl
could use the internal binder
field to check it this
binding is in the changeBindings
set.
And it will throw and IllegalStateException
if the binder
is null.
However, this is not mandatory for the PR to be merged
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
flow-data/src/test/java/com/vaadin/flow/data/binder/BinderTest.java
Outdated
Show resolved
Hide resolved
Adjust jdocs Co-authored-by: Marco Collovati <[email protected]>
Let me look into this one. Definitely would be useful. If it is a quick change, let's include this in this PR. |
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
flow-data/src/main/java/com/vaadin/flow/data/binder/Binder.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Marco Collovati <[email protected]>
… feat/has-changes-for-binding
Co-authored-by: Marco Collovati <[email protected]>
Co-authored-by: Marco Collovati <[email protected]>
is being thrown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me. Let's see if the validation passes.
Good job @benedikt-roth
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This ticket/PR has been released with Vaadin 24.3.0.alpha1 and is also targeting the upcoming stable 24.3.0 version. |
Description
Allows to check whether specific binding has been changed. So far there is only a generic Binder#hasChanges, which checks all bindings. The new method allows to check whether a specific binding has changes.
Fixes #17395
Type of change
Checklist
Additional for
Feature
type of change