What is boilerplate code
Boilerplate is the term used to describe sections of code that have to be included in many places with little or no alteration. It is more often used when referring to languages which are considered verbose, i.e. the programmer must write a lot of code to do minimal jobs.
We can use @Data to generate getters for all fields:
After using @Data:
We can use @NoArgsConstructor to generate a no-args constructor.
We can use @AllArgsConstructor to generate an all-args constructor
We can use @ToString generate an implementation for the toString method inherited by all objects, consisting of printing the values of relevant fields.