-
Notifications
You must be signed in to change notification settings - Fork 161
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
Implement ReadOnlyHasValue helper #4208
Conversation
*/ | ||
public class ReadOnlyHasValue<V> | ||
implements HasValue<ValueChangeEvent<V>, V>, Serializable { | ||
private V value; |
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.
implements HasValue<ValueChangeEvent<V>, V>, Serializable { | ||
private V value; | ||
private final SerializableConsumer<V> valueProcessor; | ||
private final V emptyValue; |
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.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks broke. a discussion (no related file): flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 106 at r2 (raw file): Quoted 21 lines of code…
This is very long anonymous class inside flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 136 at r2 (raw file):
Curly brackets around. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 142 at r2 (raw file):
Curly brackets around. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 154 at r2 (raw file):
new line Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 7 unresolved discussions. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 106 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
I can't because I need to implement those getters to return correct values for each case. I extracted a method that creates and fires the event instead. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 136 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 142 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 154 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. Comments from Reviewable |
Review status: all files reviewed at latest revision, 4 unresolved discussions. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 106 at r2 (raw file): Previously, pekam (Pekka Maanpää) wrote…
I don't really see any problem here. If you make this class nested then there will no need on the method but instead there will be a long CTOR. In the result it's the same number of lines but it's more readable. Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 4 unresolved discussions. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 106 at r2 (raw file): Previously, denis-anisimov (Denis) wrote…
Right.. Didn't realize that. Thank you! :) Comments from Reviewable |
implements ValueChangeEvent<V> { | ||
|
||
private HasValue<?, V> hasValue; | ||
private V value; |
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.
|
||
private HasValue<?, V> hasValue; | ||
private V value; | ||
private V oldValue; |
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.
Review status: 1 of 2 files reviewed at latest revision, 6 unresolved discussions. a discussion (no related file): Previously, denis-anisimov (Denis) wrote…
Done: Comments from Reviewable |
Review status: all files reviewed at latest revision, 5 unresolved discussions. flow-data/src/main/java/com/vaadin/flow/data/binder/ReadOnlyHasValue.java, line 135 at r4 (raw file):
I think we have some kind of agreement to keep nested class definitions on the top of the class. Comments from Reviewable |
Ported change from vaadin/framework#10643
This change is