Annotation Type NonNull
-
@Documented @Retention(RUNTIME) @Target({TYPE_USE,TYPE_PARAMETER}) @SubtypeOf(MonotonicNonNull.class) @DefaultQualifierInHierarchy @QualifierForLiterals(STRING) @DefaultFor(EXCEPTION_PARAMETER) @UpperBoundFor(typeKinds={PACKAGE,INT,BOOLEAN,CHAR,DOUBLE,FLOAT,LONG,SHORT,BYTE}) public @interface NonNullIf an expression's type is qualified by@NonNull, then the expression never evaluates tonull. (Unless the program has a bug; annotations specify intended behavior.)For fields of a class, the
NonNullannotation indicates that this field is nevernullafter the class has been fully initialized. For static fields, theNonNullannotation indicates that this field is nevernullafter the containing class is initialized. "Fully initialized" essentially means that the Java constructor has completed. See the Initialization Checker documentation for more details.This annotation is rarely written in source code, because it is the default.
- See Also:
Nullable,MonotonicNonNull- See the Checker Framework Manual:
- Nullness Checker, Initialization Checker, the bottom type