mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-27 22:26:17 +00:00
aaf8547d91
Also updated @Getter and @Setter's documentation to explain their new class-level feature, and updated @Data's description to highlight how @Data is now truly nothing more than the combination of @RequiredArgsConstructor, @EqualsAndHashCode, @ToString, @Getter, and @Setter.
31 lines
833 B
Plaintext
31 lines
833 B
Plaintext
@RequiredArgsConstructor(staticName = "of")
|
|
@AllArgsConstructor(access = AccessLevel.PROTECTED)
|
|
public class ConstructorExample<T> {
|
|
private int x, y;
|
|
@NonNull private T description;
|
|
|
|
private ConstructorExample(T description) {
|
|
if (description == null) throw new NullPointerException("description");
|
|
this.description = description;
|
|
}
|
|
|
|
public static <T> ConstructorExample<T> of(T description) {
|
|
return new ConstructorExample<T>(description);
|
|
}
|
|
|
|
@java.beans.ConstructorProperties({"x", "y", "description"})
|
|
protected ConstructorExample(int x, int y, T description) {
|
|
if (description == null) throw new NullPointerException("description");
|
|
this.x = x;
|
|
this.y = y;
|
|
this.description = description;
|
|
}
|
|
|
|
public static class NoArgsExample {
|
|
@NonNull private String field;
|
|
|
|
public NoArgsExample() {
|
|
}
|
|
}
|
|
}
|