RestrictTo.Scope



Summary

Enum Values

GROUP_ID

This enum value is deprecated. Use @RestrictTo(LIBRARY_GROUP_PREFIX) instead

LIBRARY

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

LIBRARY_GROUP

Restrict usage to code within the same group of libraries.

LIBRARY_GROUP_PREFIX

Restrict usage to code within packages whose Gradle group IDs share the same prefix up to the last .

SUBCLASSES

Restrict usage to subclasses of the enclosing class.

TESTS

Restrict usage to test source sets or code annotated with the TESTS restriction scope.

Public functions

RestrictTo.Scope
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Cmn
RestrictTo.Scope
valueOf(value: String)

Returns the enum constant of this type with the specified name.

android
RestrictTo.Scope
valueOf(value: String)

Returns the enum constant of this type with the specified name.

N
Array<RestrictTo.Scope>

Returns an array containing the constants of this enum type, in the order they're declared.

Cmn
Array<RestrictTo.Scope>

Returns an array containing the constants of this enum type, in the order they're declared.

android
Array<RestrictTo.Scope>

Returns an array containing the constants of this enum type, in the order they're declared.

N

Public properties

EnumEntries<RestrictTo.Scope>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Cmn
EnumEntries<RestrictTo.Scope>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

android

Enum Values

GROUP_ID

val RestrictTo.Scope.GROUP_IDRestrictTo.Scope

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

This is an alias for LIBRARY_GROUP_PREFIX.

LIBRARY

val RestrictTo.Scope.LIBRARYRestrictTo.Scope

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

LIBRARY_GROUP

val RestrictTo.Scope.LIBRARY_GROUPRestrictTo.Scope

Restrict usage to code within the same group of libraries.

This corresponds to the Gradle group ID.

LIBRARY_GROUP_PREFIX

val RestrictTo.Scope.LIBRARY_GROUP_PREFIXRestrictTo.Scope

Restrict usage to code within packages whose Gradle group IDs share the same prefix up to the last . separator.

For example, libraries foo.bar:lib1 and foo.baz:lib2 share the foo. prefix and can therefore use each other's APIs that are restricted to this scope. Similar applies to libraries com.foo.bar:lib1 and com.foo.baz:lib2, which share the com.foo. prefix.

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 . separator.

SUBCLASSES

val RestrictTo.Scope.SUBCLASSESRestrictTo.Scope

Restrict usage to subclasses of the enclosing class.

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

TESTS

val RestrictTo.Scope.TESTSRestrictTo.Scope

Restrict usage to test source sets or code annotated with the TESTS restriction scope.

This is equivalent to @VisibleForTesting(NONE).

Public functions

valueOf

fun valueOf(value: String): RestrictTo.Scope

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

valueOf

fun valueOf(value: String): RestrictTo.Scope

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

valueOf

fun valueOf(value: String): RestrictTo.Scope

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

fun values(): Array<RestrictTo.Scope>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

values

fun values(): Array<RestrictTo.Scope>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

values

fun values(): Array<RestrictTo.Scope>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

Public properties

entries

val entriesEnumEntries<RestrictTo.Scope>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.

entries

val entriesEnumEntries<RestrictTo.Scope>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.