Do More with Less Java — Lombok and Experimental Features
Lombok makes Java cool again
Table of Contents
Introduction
Stable Features
— Logging
— Constructor and Accessor
— Builder
— Cleanup
— ToString
Experimental Features
— SuperBuilder
— Tolerate
— Jacksonized
— FieldNameConstants
Introduction
Java is known to be a “wordy” programming language, developers often have to get past some boilerplate code before getting down to writing actual business logic.
Project Lombok is a mature compile time library that aims to reduce or minimise repetitive code in Java to improve developer experience. In this article, I cherrypicked some stable and experimental features which I have found to be useful from the Lombok library.
Stable Features
These are the features that are widely used and tested. Since they have been moved out of the experimental stage, the annotation usage should be pretty established and should be receiving sufficient support from the community.
Logging
Are you tired of initialising logger all the time in your application? The first Lombok annotation to the rescue will be @SLF4j: