lombok详解

  • @NonNull

or: How I learned to stop worrying and love the NullPointerException.

  • @Cleanup

Automatic resource management: Call your close() methods safely with no hassle.

自动资源管理:叫你()方法安全无死角。

  • @Getter / @Setter

Never write public int getFoo() {return foo;} again.

不写getfoo() { public int foo再次回归;}。

  • @ToString

No need to start a debugger to see your fields: Just let lombok generate a toString for you!

不需要启动调试器看到你的领域:让lombok生成toString你!

  • @EqualsAndHashCode

Equality made easy: Generates hashCode and equals implementations from the fields of your object.

平等轻松:生成hashCode和等于从你的域对象的实现。

  • @NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor

Constructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field.

按顺序顺序生成的构造函数:生成构造函数,不带任何参数,每一个最终/非空字段的一个参数,或每一个字段的一个参数。

  • @Data

All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and@RequiredArgsConstructor!

现在在一起:“toString,快捷”equalsandhashcode,@Getter,和@Setter,和“requiredargsconstructor!

  • @Value

Immutable classes made very easy.

不变的类很容易。

  • @Builder

... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!

  • @SneakyThrows

To boldly throw checked exceptions where no one has thrown them before!

  • @Synchronized

synchronized done right: Don't expose your locks.

  • @Getter(lazy=true)

Laziness is a virtue!

  • @Log

Captain's Log, stardate 24435.7: "What was that line again?"

  • Configuration system

Lombok, made to order: Configure lombok features in one place for your entire project or even your workspace.

  • Experimental features

Here be dragons: Extra features which aren't quite ready for prime time yet.

你可能感兴趣的:(lombok详解)