@Documented @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(value=MonotonicNonNull.class) @QualifierForLiterals(value=STRING) @DefaultQualifierInHierarchy @DefaultFor(value=EXCEPTION_PARAMETER) @UpperBoundFor(typeKinds={PACKAGE,INT,BOOLEAN,CHAR,DOUBLE,FLOAT,LONG,SHORT,BYTE}) public @interface NonNull
@NonNull
, then the expression never evaluates to
null
.
For fields of a class, the NonNull
annotation indicates that this field is never
null
after the class has been fully initialized. For static fields, the NonNull
annotation indicates that this field is never null
after the containing
class is initialized. See InitializationChecker
for more details.
This annotation is rarely written in source code, because it is the default.
Nullable
,
MonotonicNonNull
,
NullnessChecker