简体   繁体   中英

how to generate constructor in a enum using Lombok

I want to use lombok in a enum, but I can't find the annotation to generate the constructor. I checked the Lombok manual that it shows there should be a annotion named @XArgsConstructor,but I can't find it, any advice ? thanks.

X in @XArgsConstructor is just a placeholder for No , Required or All .

The real annotations are @NoArgsConstructor , @RequiredArgsConstructor and @AllArgsConstructor . Pick one of these (I'd go for @AllArgsConstructor by default), and it'll work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM