{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

RestrictTo.Scope

public enum RestrictTo.Scope extends Enum

java.lang.Object
   ↳ kotlin.Enum
     ↳ androidx.annotation.RestrictTo.Scope

Summary

Enum Values

GROUP_ID

This enum value is deprecated. Use 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 groups share the same library group prefix up to the last ".", so for example libraries foo.bar:lib1 and foo.baz:lib2 share the prefix "foo." and so they can use each other's apis that are restricted to this scope.

SUBCLASSES

Restrict usage to subclasses of the enclosing class.

TESTS

Restrict usage to tests.

Public methods

final @NonNull EnumEntries<@NonNull RestrictTo.Scope>

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

final @NonNull EnumEntries<@NonNull RestrictTo.Scope>

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

final @NonNull RestrictTo.Scope

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

final @NonNull RestrictTo.Scope

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

final @NonNull RestrictTo.Scope[]

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

final @NonNull RestrictTo.Scope[]

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

Enum Values

GROUP_ID

RestrictTo.Scope RestrictTo.Scope.GROUP_ID

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

Use LIBRARY_GROUP_PREFIX instead

LIBRARY

RestrictTo.Scope RestrictTo.Scope.LIBRARY

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

LIBRARY_GROUP

RestrictTo.Scope RestrictTo.Scope.LIBRARY_GROUP

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

LIBRARY_GROUP_PREFIX

RestrictTo.Scope RestrictTo.Scope.LIBRARY_GROUP_PREFIX

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 and 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

RestrictTo.Scope RestrictTo.Scope.SUBCLASSES

Restrict usage to subclasses of the enclosing class.

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

TESTS

RestrictTo.Scope RestrictTo.Scope.TESTS

Restrict usage to tests.

Public methods

getEntries

public final @NonNull EnumEntries<@NonNull RestrictTo.ScopegetEntries()

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.

getEntries

public final @NonNull EnumEntries<@NonNull RestrictTo.ScopegetEntries()

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.

valueOf

public final @NonNull RestrictTo.Scope valueOf(@NonNull String value)

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

public final @NonNull RestrictTo.Scope valueOf(@NonNull String value)

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

public final @NonNull RestrictTo.Scope[] values()

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

public final @NonNull RestrictTo.Scope[] values()

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.