Annotation Type NotNullByDefault


@Target({TYPE,LOCAL_VARIABLE,METHOD,CONSTRUCTOR,FIELD,PACKAGE}) @Retention(CLASS) public @interface NotNullByDefault
By default, types in method signatures that lack a null annotation are regarded as nullable. This annotation (with it default value true) indicates that types in method signatures that lack a null annotation are regarded as non-null. It is generally good practice to add @NotNullByDefault to all your package declarations (i.e. 'package-into.java' files), because in well-designed code (especially API methods), @NonNull is significantly more frequent than @Nullable.
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
  • Element Details

    • value

      boolean value
      Default:
      true