@Documented @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(value={}) @QualifierForLiterals(value=NULL) @DefaultFor(types=java.lang.Void.class) public @interface Nullable
Nullable
is a type annotation that makes no commitments about whether the value is null
. Equivalently, the type includes the null
value.
The Nullness Checker issues an error if null
is assigned an expression of NonNull
type.
Programmers typically write @Nullable
to indicate that the value is not known to be
NonNull
. However, since @Nullable
is a supertype of @NonNull
, an
expression that never evaluates to null
can have a declared type of @Nullable
.
NonNull
,
MonotonicNonNull
,
NullnessChecker