不能在类上使用 lombok @NoArgsConstructor

Mac*_*iaz 3 java jackson lombok

我使用 Jackson 作为 Json 解析器,但出现错误:

No suitable constructor found for type ~ can not instantiate from JSON object
Run Code Online (Sandbox Code Playgroud)

所以我尝试添加@NoArgsConstructor,但现在我得到了这个:

constructor AccountItem in class AccountItem cannot be applied to given types
Run Code Online (Sandbox Code Playgroud)

这是我的课:

@Getter
@Builder
public class AccountItem {

/**
 * Accounti dentifier
 */
private Long accountId;

/**
 * Account name
 */
private String accountName;

/**
 * Account priority
 */
private int accountPriority;
}
Run Code Online (Sandbox Code Playgroud)

可能是什么原因?

cac*_*co3 10

@AllArgsConstructor@NoArgsConstructor注释添加到您的课程中