Annotation Type Nullable


  • @Documented
    @Retention(CLASS)
    @Target({METHOD,FIELD,PARAMETER,LOCAL_VARIABLE,TYPE_USE})
    @Nonnull(when=MAYBE)
    @TypeQualifierNickname
    public @interface Nullable
    The annotated element can be null under some circumstance. We consequently use the convention of no annotation means not nullable. All API packages there for have the annotation NonNullApi

    The annotation name Nullable is sufficient for static analysis frameworks like NullAway. For additional compatibility with Kotlin this is a nickname of the JSR305 annotation. For this to work the JSR305 annotations do not need to be on the class path.

    This approach is identical to the Spring framework.

    Author:
    Jens Wilke
    See Also:
    ,