From the course: Learning Lombok: Streamlined Java Programming
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: Reduce boilerplate code in POJOs - Spring Tutorial
From the course: Learning Lombok: Streamlined Java Programming
Solution: Reduce boilerplate code in POJOs
(upbeat music) - [Instructor] Well, you made it, congratulations. This means that you pushed through the first challenge and you're ready to walk through the solution. Please keep your project code 01 07 Challenge LombokDemo open and follow along with me to see if your code matches mine. The final solutions for this challenge will be found in 01 08 solution project files. Okay, so our first task was to open up the address entity and replace the @setter and @getter with the @data annotation. This is going to be followed by applying an @allargsConstructor, along with an @noargsConstructor. You'll notice here that IntelliJ is telling us that the no ARGs constructor is conflicting with another constructor. So let's go to the bottom and we're going to go ahead and take care of that. We'll remove both the default constructor, which is the no ARGs, and we'll remove this other all ARGs constructor we created early on.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Abating setter and getter code bloat4m 52s
-
(Locked)
Adding but reducing ToString, Equals, and HashCode methods4m 22s
-
(Locked)
Pairing down constructor bloat3m 57s
-
(Locked)
One annotation to rule them all5m 20s
-
(Locked)
Playing nicely with Spring @Autowired4m 28s
-
(Locked)
JEP 359 record versus @Data and @Value5m 6s
-
(Locked)
Challenge: Reduce boilerplate code in POJOs3m 29s
-
(Locked)
Solution: Reduce boilerplate code in POJOs5m 23s
-
-
-
-