These Getters
and Setters
of the class data members are generated by the @Setter
and @Getter
annotation of Lombok.
Further you can use @Data
which implicitly calls
@Getter
@Setter
@RequiredArgsConstructor
@ToString
Basically we are using these annotation of lombok to remove boilerplate code.
Example:
@Data
Class tax{
private int tax;
}
Now we don't need to explicitly define getter and setters for it like.
private int gettax(){
return tax;
}
private void settax(int tax){
this.tax = tax;
}
https://projectlombok.org/features/Data
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…