Annotation Type DoNotCall


  • @Retention(CLASS)
    @Target(METHOD)
    public @interface DoNotCall
    The method to which this annotation is applied cannot be called.

    The annotation is applied to methods that are required to satisfy the contract of an interface, but that are not supported. One example is the implementation of Collection.add(E) in an immutable collection implementation.

    Marking methods annotated with @DoNotCall as @Deprecated is recommended, since it provides IDE users with more immediate feedback.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String value
      An optional explanation of why the method should not be called.
    • Element Detail

      • value

        String value
        An optional explanation of why the method should not be called.
        Default:
        ""