View Javadoc
1   package net.florianschoppmann.java.type;
2   
3   import javax.annotation.Nonnull;
4   import javax.annotation.meta.TypeQualifierDefault;
5   import java.lang.annotation.ElementType;
6   import java.lang.annotation.Retention;
7   import java.lang.annotation.RetentionPolicy;
8   
9   /**
10   * Annotation to define that all contained entities for which a {@code null} annotation is otherwise lacking should be
11   * considered as {@link Nonnull}.
12   *
13   * <p>This annotation can be applied to all element types.
14   */
15  @TypeQualifierDefault({
16      ElementType.ANNOTATION_TYPE,
17      ElementType.CONSTRUCTOR,
18      ElementType.FIELD,
19      ElementType.LOCAL_VARIABLE,
20      ElementType.METHOD,
21      ElementType.PACKAGE,
22      ElementType.PARAMETER,
23      ElementType.TYPE
24  })
25  @Nonnull
26  @Retention(RetentionPolicy.RUNTIME)
27  public @interface NonNullByDefault { }