Erstellen von Enums mit Lombok

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Erstellen von Enums mit Lombok

by Anonymous » Yesterday, 01:23

Ich verwende Project Lombok mit meiner Anwendung. Ich habe eine Aufzählung geschaffen. Wenn ich < /p>


@AllargSconstr. />
import lombok.Getter;
import lombok.AllArgsConstructor

@AllArgsConstructor
public enum Direction {
NORTH("NORTH"), // all these enums give error, for no constructor
SOUTH("SOUTH"),
EAST("EAST"),
WEST("WEST");

@Getter private String value;
}
< /code>

P.S.: Ich verwende Intellij-idea, die das Lombok-Plugin installiert. Meine Lombok -Abhängigkeitsversion ist: 1.16.20

Top