Package 

Annotation RestrictTo

  • All Implemented Interfaces:
    java.lang.annotation.Annotation

    @Retention(value = )@Target(value = {}) 
    public @interface RestrictTo
    
                        

    Denotes that the annotated element should only be accessed from within a specific scope (as defined by Scope).

    Example of restricting usage within a library (based on gradle group ID):

     @RestrictTo(GROUP_ID) public void resetPaddingToInitialValues() { ... 
    Example of restricting usage to tests:
     @RestrictScope(TESTS) public abstract int getUserId(); 
    Example of restricting usage to subclasses:
     @RestrictScope(SUBCLASSES) public void onDrawForeground(Canvas canvas) { ... 
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum RestrictTo.Scope
    • Method Summary

      Modifier and Type Method Description
      abstract Array<RestrictTo.Scope> value() The scope to which usage should be restricted.
      • Methods inherited from class java.lang.annotation.Annotation

        annotationType, equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait