@AllArgsConstructor 是否为静态成员创建构造函数?
Does @AllArgsConstructor create constructor for static member?
为此 class @AllArgsConstructor 会为计数创建字段吗?
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Money {
private int paisa;
private int rs;
private static int count;
}
不,不会。
看这里:https://projectlombok.org/features/constructor
Static fields are skipped by these annotations.
为此 class @AllArgsConstructor 会为计数创建字段吗?
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Money {
private int paisa;
private int rs;
private static int count;
}
不,不会。
看这里:https://projectlombok.org/features/constructor
Static fields are skipped by these annotations.