Annotation VisibleForTesting

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

    @Documented()@Retention(value = RetentionPolicy.SOURCE) 
    public @interface VisibleForTesting
    
                        

    Denotes that the class, method or field has its visibility relaxed so that unit tests can access it. This means that this API is not-public. The visibility argument can be used to specific what the original visibility should have been if it had not been made public or package-private for testing. The default is to consider the element private. Copy of this class under ASL license: https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/com/android/internal/annotations/VisibleForTesting.java

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum VisibleForTesting.Visibility

      Intended visibility if the element had not been made public or package-private for testing.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract VisibleForTesting.Visibility visibility() If no visibility specified, one should assume the element originally intended to be private.
      • 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
    • Constructor Detail

    • Method Detail

      • visibility

         abstract VisibleForTesting.Visibility visibility()

        If no visibility specified, one should assume the element originally intended to be private.

        Returns:

        Visibility Intended visibility if the element had not been made public or package-private for testing.