From 2e35148abe0245427ce579b2afbb36d1496979ed Mon Sep 17 00:00:00 2001
From: Roel Spilker
Lombok can add nullity annotations (usually called @NonNull
and @Nullable
) whenever it makes sense to do so; think of generated toString
and withX
methods (these never return null), or the parameter of a generated equals
method, which is allowed to be null, and requires such an annotation if you've set up your IDE for strict null checks as well as 'parameters are non-null by default'. There are many such libraries; you must tell lombok which one to use. By default, no such annotations are added. Enable this feature with:
-
lombok.addNullAnnotations = <flavor>
javax
(=JSR305; not recommended), eclipse
, jetbrains
, netbeans
, androidx
, android.support
(deprecated within android), checkerframework
(recommended), findbugs
, spring
, jml
, or define your own via CUSTOM:fully.qualified.NonNullAnnotation:fully.qualified.NullableAnnotation
; if your nullity annotation is solely of the type use style (it annotates types, such as eclipse's and checkerframework's offerings, versus annotating methods and parameters), the format is CUSTOM:TYPE_USE:nonnullanno:nullableanno
.