Learning Lombok: Streamlined Java Programming
1h 40mIntermediate2023-04-11
Authors

Michael D. Rodgers, Jr
Java Web Applications Engineer and Consultant
Course details
When writing Java programs, there’s a lot of standard, repetitive code required, and writing this boilerplate code can be time-consuming and tedious. In this course, instructor Michael D. Rodgers, Jr. shows you how you can use the Project Lombok Java library to generate all the required boilerplate code, behind the scenes, in a fraction of the time without the clutter and mess. He shows how to install the plugin into Eclipse and IntelliJ and the proper Maven dependencies needed for your project. From there, he covers the basics: refactoring some basic classes and walking through the use cases for reducing time in writing code, reducing boilerplate code—and as a result writing code that is inherently much safer and more bug free. Michael also covers the current features and experimental features in Lombok that will reduce and improve a developer's code even more.
Skills covered
SpringProgramming LanguagesOpen SourceSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Lombok for Java developers
- 02 - Project overview and exercise files
- 03 - Configure your IDE - Eclipse or IntelliJ
1. Reducing Boilerplate Code in POJOs with Lombok
- 04 - Abating setter and getter code bloat
- 05 - Adding but reducing ToString, Equals, and HashCode methods
- 06 - Pairing down constructor bloat
- 07 - One annotation to rule them all
- 08 - Playing nicely with Spring @Autowired
- 09 - JEP 359 record versus @Data and @Value
- 10 - Challenge - Reduce boilerplate code in POJOs
- 11 - Solution - Reduce boilerplate code in POJOs
2. Utilizing Simplified Lombok POJOs
- 12 - Lombok implements a builder design pattern
- 13 - Simplifying null checks and removing bloat
- 14 - Simplify final local variable declaration
- 15 - Mutable local variables versus JEP 286 var
- 16 - Mutable setters using Lombok @With
- 17 - Challenge - Utilizing simplified Lombok POJOs
- 18 - Solution - Utilizing simplified Lombok POJOs
3. Important Class Additives Provided by Lombok
- 19 - Simplify logging boilerplate code
- 20 - Cleaning up code and releasing resources
- 21 - Caching expensive one-time calculations
- 22 - Shorten your exception handling with SneakyThrows
- 23 - Challenge - Apply logging and cleanup
- 24 - Solution - Apply logging and cleanup
Conclusion
- 25 - Features for your next project
Related courses
- Linux Performance Tuning
- Learning MongoDB
- Microsoft Entra ID for Developers: A Beginner's Guide (2023)
- Introduction to SQLite
- Learning BIM 360 Building Ops
- Learning Power Automate Desktop for Non-Developers
- The OWASP API Security Top 10: An Overview
- Azure VMware Solution: Planning and Troubleshooting Basics