Tagged: boilerplate code

Java Getters and Setters with Lombok

Sick of all the boilerplate code required to create simple getter/setters with Java? Checkout project Lombok! Let’s suppose we want to create a simple class with the following: public getter/setter for age protected setter for name With Vanilla Java, we might do the following: However, with Lombok (we remove most of the cruft) and we simply write: How cool?!?! Thank you!


Get every new post on this blog delivered to your Inbox.

Join other followers: