avaje-lang
Provides @NonNullAPI
and @Nullable
for APIs
Step 1. Add dependency
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-lang</artifactId>
<version>1.1</version>
</dependency>
@NonNullAPI
on either package-info or a type
Step 2. Put This defines the return type and parameters to be @Nonnull
by default
@Nullable
on anything that can be nullable
Step 3. Put How it works
These annotations are meta annotations using jsr-305
annotations (javax.annotation
)
and are then honored by most tools - IntelliJ etc.
Note that these annotations are RetentionType CLASS and expected to be used at compile time only via static analysis and can not be read or used at runtime.
The jsr-305
annotations are not required to be a transitive dependency for the tooling
like IntelliJ to recognise and use.