The Android Developer Challenge is back! Submit your idea before December 2.

Scope

class Scope
kotlin.Any
   ↳ kotlin.Enum<androidx.annotation.RestrictTo.Scope>
   ↳ androidx.annotation.RestrictTo.Scope

Summary

Enum values

Restrict usage to code within the same group ID (based on gradle group ID).

Restrict usage to code within the same library (e.g. the same gradle group ID and artifact ID).

Restrict usage to code within the same group of libraries.

Restrict usage to code within packages whose groups share the same library group prefix up to the last ".

Restrict usage to subclasses of the enclosing class.

Restrict usage to tests.

Enum values

GROUP_ID

enum val GROUP_ID : RestrictTo.Scope

Deprecated: Use LIBRARY_GROUP_PREFIX instead

Restrict usage to code within the same group ID (based on gradle group ID). This is an alias for LIBRARY_GROUP_PREFIX.

LIBRARY

enum val LIBRARY : RestrictTo.Scope

Restrict usage to code within the same library (e.g. the same gradle group ID and artifact ID).

LIBRARY_GROUP

enum val LIBRARY_GROUP : RestrictTo.Scope

Restrict usage to code within the same group of libraries. This corresponds to the gradle group ID.

LIBRARY_GROUP_PREFIX

enum val LIBRARY_GROUP_PREFIX : RestrictTo.Scope

Restrict usage to code within packages whose groups share the same library group prefix up to the last ".", so for example libraries foo.bar:lib1 amd foo.baz:lib2 share the prefix "foo." and so they can use each other's apis that are restricted to this scope. Similarly for com.foo.bar:lib1 and com.foo.baz:lib2 where they share "com.foo.". Library com.bar.qux:lib3 however will not be able to use the restricted api because it only shares the prefix "com." and not all the way until the last ".".

SUBCLASSES

enum val SUBCLASSES : RestrictTo.Scope

Restrict usage to subclasses of the enclosing class.

Note: This scope should not be used to annotate packages.

TESTS

enum val TESTS : RestrictTo.Scope

Restrict usage to tests.