Annotation Type Value
Generates a lot of code which fits with a class that is a representation of an immutable entity.
Equivalent to @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @AllArgsConstructor @ToString @EqualsAndHashCode
.
Complete documentation is found at the project lombok features page for @Value.
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionIf you specify a static constructor name, then the generated constructor will be private, and instead a static factory method is created that other classes can use to create instances.
-
Element Details
-
staticConstructor
String staticConstructorIf you specify a static constructor name, then the generated constructor will be private, and instead a static factory method is created that other classes can use to create instances. We suggest the name: "of", like so:public @Value(staticConstructor = "of") class Point { final int x, y; }
Default: No static constructor, instead the normal constructor is public.- Returns:
- Name of static 'constructor' method to generate (blank = generate a normal constructor).
- Default:
""
-