5 ms·
It isn't perfect, but Lombok[1] helps with this. It uses annotations to automatically generate getters and setters. The downside, of course, it yet another depe
by bollockitis 12y ago
It isn't perfect, but Lombok[1] helps with this. It uses annotations to automatically generate getters and setters. The downside, of course, it yet another dependency and more annotations.
[1]: http://projectlombok.org/features/GetterSetter.html http://projectlombok.org/features/GetterSetter.html
- evacchi 12y agoYou can setup your build process to "delombok" your sources, so that the dependency would only be compile-time (which is pretty neat). Also, Lombok has @Data http://projectlombok.org/features/Data.html http://projectlombok.org/features/Data.html
- maherbeg 12y agoWhat's even better is @Value with @Builder :) Immutability is the best. http://projectlombok.org/features/Value.html http://projectlombok.org/features/Value.html http://projectlombok.org/features/experimental/Builder.html http://projectlombok.org/features/experimental/Builder.html