Last Update: 17.04.2018. By Jens in Developers Life | Learning | Newsletter
As much as I love Java, yeah it is still one of my languages of choice after 2 decades, one thing that feels pretty annoying all the time is adhering to the Java Bean convention and thus providing getter and setter and sometimes a few others. The convention itself makes sense and a lot of the libs in the Java world require it. Yet, it never made it into the compiler and automatically provide it. Kotlin does it, why not Java?
Lucky, Project Lombok eased that issue a bit by reducing it to a handful of annotations. The most popular is probably @Data , which will create toString, equals, hashCode and all getter and setter and create a constructor with all fields, by just putting it on your data class.
Lombok uses the annotation processing mechanics of the Java compiler and will generate those methods during compile time. Transparent for us. The only obstacle is, that we now need Lombok support in out IDEs, but that’s solved by just installing a plugin.