javalombokintellij-lombok-plugin

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.


Solution

  • 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.