Refactoring to add and remove new fields
Answered
Stupid question time as I'm starting to wonder if I just dreamed doing this in the past. Is there a way to add a new property to a given class and automatically have the getter & setters created and any equals() and hascode() methods updated? Probally a similar set of changes in reverse for property removal.
PS. Just out of interest has anybody been able to template the creation of PropertyChangeListener bound beans? or for that matter any other binding framework beans.
- Richard
Please sign in to leave a comment.
I wondered this today as well.
We have a big feature toggle class where removing a field or adding one it could be helpful to have a more automatic way.
With plugin "Lombok" enabled, it should be much easier to control getter and setter.
Jerome Guan Thank you for your advice. But this is a No Go library for me. As it adds complexity add a different level.
For me the most interesting part is rather the removal of related getter/setter as a refactoring option. As generating as you point out is fairly easy with the alt insert method.