Lombok

   1 <dependency>
   2   <groupId>org.projectlombok</groupId>
   3   <artifactId>lombok</artifactId>
   4   <scope>provided</scope>
   5 </dependency>

   1 import lombok.AllArgsConstructor;
   2 import lombok.Getter;
   3 import lombok.NonNull;
   4 import lombok.Setter;
   5 
   6 @Getter
   7 @Setter
   8 // generate getters and setters
   9 @AllArgsConstructor
  10 // requires construtor for all args
  11 @NoArgsConstructor
  12 // construtor with no args
  13 @NonNull
  14 // null value not allowed to member
  15 

Java/Lombok (last edited 2023-05-29 09:09:21 by 127)