如何编写构造函数而不是使用 Lombok 访问 public 级别?
How to write the constructor instead of using Lombok to access public level?
我将受保护的访问级别更改为 public 但是如何编写构造函数而不是使用 Lombok 来编写以下代码?
@RequiredArgsConstructor(access = AccessLevel.PUBLIC))
public class abc implements xyz<Event, Void> {
@NonNull private final Test<Lock<TransactionLock, TransactionLockId>> test;
..... }
如果没有定义其他 final
字段,应该是:
public class abc implements xyz<Event, Void> {
@NonNull private final Test<Lock<TransactionLock, TransactionLockId>> test;
public abc(@NotNull Test<Lock<TransactionLock, TransactionLockId>> test) {
this.test = test;
}
j
我将受保护的访问级别更改为 public 但是如何编写构造函数而不是使用 Lombok 来编写以下代码?
@RequiredArgsConstructor(access = AccessLevel.PUBLIC))
public class abc implements xyz<Event, Void> {
@NonNull private final Test<Lock<TransactionLock, TransactionLockId>> test;
..... }
如果没有定义其他 final
字段,应该是:
public class abc implements xyz<Event, Void> {
@NonNull private final Test<Lock<TransactionLock, TransactionLockId>> test;
public abc(@NotNull Test<Lock<TransactionLock, TransactionLockId>> test) {
this.test = test;
}
j