-
@Documented @Nonnull(when=MAYBE) @Retention(RUNTIME) @Target({TYPE_USE,TYPE_PARAMETER}) @TypeQualifierNickname public @interface NullOr
Declares that the annotated type use (e.g. field, method return type, method parameter, type parameter, local variable) can benull.Should be used at type use level in association with
NonNullPackageannotation at package level.Recognized by IDEs (e.g. IntelliJ) and by Kotlin (to infer nullability for its types).
Analogous to (except for the scope of allowed targets):
Nullablein Spring,CheckForNullin JSR 305.- Author:
- Tomasz Linkowski