@Data :注解在類上;提供類所有屬性的 getting 和 setting 方法,此外還提供了equals、canEqual、hashCode、toString 方法
@Setter:注解在屬性上;為屬性提供 setting 方法
@Getter:注解在屬性上;為屬性提供 getting 方法
@Log4j :注解在類上;為類提供一個(gè) 屬性名為log 的 log4j 日志對(duì)象
@NoArgsConstructor:注解在類上;為類提供一個(gè)無參的構(gòu)造方法
@AllArgsConstructor:注解在類上;為類提供一個(gè)全參的構(gòu)造方法
@NonNull:注解在參數(shù)上 如果該參數(shù)為null 會(huì)throw new NullPointerException(參數(shù)名);
@Cleanup:注釋在引用變量前:自動(dòng)回收資源 默認(rèn)調(diào)用close方法
@Cleanup("dispose") org.eclipse.swt.widgets.CoolBar bar = new CoolBar(parent, 0);
@Cleanup InputStream in = new FileInputStream(args[0]);
@Cleanup OutputStream out = new FileOutputStream(args[1]);
@Builder:注解在類上;為類提供一個(gè)內(nèi)部的Builder
官網(wǎng):
https://projectlombok.org/
英文原版:
https://projectlombok.org/features/index.html