This package contains all the annotations and support classes you need as a user of lombok. All other packages are only relevant to those who are extending lombok for their own uses, except:
lombok.extern.*– These packages contains lombok annotations that solve boilerplate issues for libraries not part of the JRE itself.
lombok.experimental– This package contains lombok features that are new or likely to change before committing to long-term support.
- See Also:
ClassDescriptionRepresents an AccessLevel.Generates an all-args constructor.Deprecated.Don't use this annotation, ever - Read the documentation.The builder annotation creates a so-called 'builder' aspect to the class that is annotated or the class that contains a member which is annotated with
@Builder.The field annotated with
@Defaultmust have an initializing expression; that expression is taken as the default to be used if not explicitly set during building.Put on a field (in case of
@Builderon a type) or a parameter (for
@Builderon a constructor or static method) to indicate how lombok should obtain a value for this field or parameter given an instance; this is only relevant if
true.Ensures the variable declaration that you annotate will be cleaned up by calling its close method, regardless of what happens.A container class containing all lombok configuration keys that do not belong to a specific annotation.Causes lombok to generate a logger field based on a custom logger implementation.Generates getters for all fields, a useful toString method, and hashCode and equals implementations that check all non-transient fields.Deprecated.Use
Delegateinstead.Generates implementations for the
hashCodemethods inherited by all objects, based on relevant fields.Deprecated.Don't use this annotation, ever - Read the documentation.If present, do not include this field in the generated
hashCodemethods.Configure the behaviour of how this member is treated in the
hashCodeimplementation; if on a method, include the method's return value as part of calculating hashCode/equality.Lombok will eventually automatically add this annotation to all generated constructors, methods, fields, and types.Put on any field to make lombok build a standard getter.Deprecated.Don't use this annotation, ever - Read the documentation.Useful utility methods to manipulate lombok-generated code.Generates a no-args constructor.Deprecated.Don't use this annotation, ever - Read the documentation.If put on a parameter, lombok will insert a null-check at the start of the method / constructor's body, throwing a
NullPointerExceptionwith the parameter's name as message.Generates a constructor with required arguments.Deprecated.Don't use this annotation, ever - Read the documentation.Put on any field to make lombok build a standard setter.Deprecated.Don't use this annotation, ever - Read the documentation.The singular annotation is used together with
@Builderto create single element 'add' methods in the builder for collections.@SneakyThrow will avoid javac's insistence that you either catch or throw onward any checked exceptions that statements in your method body declare they generate.Almost exactly like putting the 'synchronized' keyword on a method, except will synchronize on a private internal Object, so that other code not under your control doesn't meddle with your thread management by locking on your own instance.Generates an implementation for the
toStringmethod inherited by all objects, consisting of printing the values of relevant fields.If present, do not include this field in the generated
toString.Configure the behaviour of how this member is rendered in the
toString; if on a method, include the method's return value in the output.Use
valas the type of any local variable declaration (even in a for-each statement), and the type will be inferred from the initializing expression.Generates a lot of code which fits with a class that is a representation of an immutable entity.Use
varas the type of any local variable declaration (even in a
forstatement), and the type will be inferred from the initializing expression (any further assignments to the variable are not involved in this type inference).Put on any field to make lombok build a 'with' - a withX method which produces a clone of this object (except for 1 field which gets a new value).Deprecated.Don't use this annotation, ever - Read the documentation.