@Target(value=TYPE) @Retention(value=SOURCE) public @interface NoArgsConstructor
Complete documentation is found at the project lombok features page for @Constructor.
Even though it is not listed, this annotation also has the onConstructor parameter. See the full documentation for more details.
NB: Fields with constraints such as @NonNull will NOT be checked in a @NoArgsConstructor constructor, of course!
RequiredArgsConstructor,
AllArgsConstructor| Modifier and Type | Optional Element and Description |
|---|---|
AccessLevel |
access
Sets the access level of the constructor.
|
boolean |
force
If
true, initializes all final fields to 0 / null / false. |
NoArgsConstructor.AnyAnnotation[] |
onConstructor
Any annotations listed here are put on the generated constructor.
|
String |
staticName
If set, the generated constructor will be private, and an additional static 'constructor'
is generated with the same argument list that wraps the real constructor.
|
public abstract String staticName
public abstract NoArgsConstructor.AnyAnnotation[] onConstructor
@NoArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))@NoArgsConstructor(onConstructor_={@AnnotationsGohere}) // note the underscore after onConstructor.public abstract AccessLevel access
public.Copyright © 2025. All rights reserved.