avaje / avaje-lang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Maven Central License JDK EA

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>

Step 2. Put @NonNullAPI on either package-info or a type

This defines the return type and parameters to be @Nonnull by default

Step 3. Put @Nullable on anything that can be nullable

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.

References

About

License:Apache License 2.0


Languages

Language:Java 100.0%