001package io.avaje.lang;
002
003import java.lang.annotation.Documented;
004import java.lang.annotation.ElementType;
005import java.lang.annotation.Retention;
006import java.lang.annotation.RetentionPolicy;
007import java.lang.annotation.Target;
008
009import javax.annotation.Nonnull;
010import javax.annotation.meta.TypeQualifierDefault;
011
012/**
013 * A common annotation to declare that parameters and return values
014 * are to be considered as non-nullable by default for a given package.
015 *
016 * <p>Leverages JSR-305 meta-annotations to indicate nullability in Java to common
017 * tools with JSR-305 support and used by Kotlin to infer nullability of API.
018 *
019 * <p>Should be used in association with Nullable annotations at parameter
020 * and return value level.
021 */
022@Target({ElementType.PACKAGE, ElementType.TYPE})
023@Retention(RetentionPolicy.CLASS)
024@Documented
025@Nonnull
026@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
027public @interface NonNullApi {
028}
029