bourbon2756
bourbon2756

Reputation: 9

How to write the constructor instead of using Lombok to access public level?

I changed the access level protected to public but how to write the constructor instead of using Lombok for below code?

@RequiredArgsConstructor(access = AccessLevel.PUBLIC))
public class abc implements xyz<Event, Void> {

    @NonNull private final Test<Lock<TransactionLock, TransactionLockId>> test;

    ..... }

Upvotes: -1

Views: 68

Answers (1)

Nowhere Man
Nowhere Man

Reputation: 19565

It should be if there are no other final fields defined:

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

Upvotes: 0

Related Questions