# RestrictTo.Scope

Summary:[Enums](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#enumconstants)\|[Methods](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#)  

# RestrictTo.Scope

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static
final

enum
RestrictTo.Scope
`  
`


``

extends Enum<`[RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)`>


``


`

|---|---|---------------------------------------------|
| java.lang.Object                                  |||
| ↳ | java.lang.Enum\<[android.support.annotation.RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)\> ||
|   | ↳ | android.support.annotation.RestrictTo.Scope |

<br />

*** ** * ** ***

## Summary

|                                                                                                                               ### Enum values                                                                                                                                ||
|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | `GROUP_ID` *This field is deprecated. Use[LIBRARY_GROUP](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#LIBRARY_GROUP)instead* |
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | `LIBRARY` Restrict usage to code within the same library (e.g.                                                                                                      |
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | `LIBRARY_GROUP` Restrict usage to code within the same group of libraries.                                                                                          |
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | `SUBCLASSES` Restrict usage to subclasses of the enclosing class.                                                                                                   |
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | `TESTS` Restrict usage to tests.                                                                                                                                    |

|                                                                                                                       ### Public methods                                                                                                                       ||
|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | ` `[valueOf](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#valueOf(java.lang.String))`(String name) ` |
| ` static final `[Scope[]](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)    | ` `[values](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#values())`() `                              |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#)From class` java.lang.Enum ` |---------------------------------|-------------------------------------------------------------------------------------------------------------------------------| | ` final Object`                 | ` clone() `                                                                                                                   | | ` final int`                    | ` compareTo(`[RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)` arg0) ` | | ` int`                          | ` compareTo(Object arg0) `                                                                                                    | | ` final boolean`                | ` equals(Object arg0) `                                                                                                       | | ` final void`                   | ` finalize() `                                                                                                                | | ` final Class<E>`               | ` getDeclaringClass() `                                                                                                       | | ` final int`                    | ` hashCode() `                                                                                                                | | ` final String`                 | ` name() `                                                                                                                    | | ` final int`                    | ` ordinal() `                                                                                                                 | | ` String`                       | ` toString() `                                                                                                                | | ` static <T extends Enum<T>> T` | ` valueOf(Class<T> arg0, String arg1) `                                                                                       | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#)From interface` java.lang.Comparable ` |-----------------|-----------------------| | ` abstract int` | ` compareTo(E arg0) ` | ||

## Enum values

### GROUP_ID

```
RestrictTo.Scope GROUP_ID
```

<br />

**This field is deprecated.**   
Use[LIBRARY_GROUP](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#LIBRARY_GROUP)instead

Restrict usage to code within the same group ID (based on gradle group ID). This is an alias for[LIBRARY_GROUP](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope#LIBRARY_GROUP).

<br />

### LIBRARY

```
RestrictTo.Scope LIBRARY
```

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

<br />

### LIBRARY_GROUP

```
RestrictTo.Scope LIBRARY_GROUP
```

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

<br />

### SUBCLASSES

```
RestrictTo.Scope SUBCLASSES
```

Restrict usage to subclasses of the enclosing class.

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

<br />

### TESTS

```
RestrictTo.Scope TESTS
```

Restrict usage to tests.

<br />

## Public methods

### valueOf

```
RestrictTo.Scope valueOf (String name)
```

<br />

<br />

|       Parameters        ||
|--------|-----------------|
| `name` | `String` <br /> |

|                                                     Returns                                                     ||
|---------------------------------------------------------------------------------------------------------|--------|
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | <br /> |

### values

```
Scope[] values ()
```

<br />

<br />

|                                                Returns                                                 ||
|------------------------------------------------------------------------------------------------|--------|
| [Scope[]](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) | <br /> |

-

  ## Annotations

  - [AnimatorRes](https://developer.android.com/reference/android/support/annotation/AnimatorRes)
  - [AnimRes](https://developer.android.com/reference/android/support/annotation/AnimRes)
  - [AnyRes](https://developer.android.com/reference/android/support/annotation/AnyRes)
  - [AnyThread](https://developer.android.com/reference/android/support/annotation/AnyThread)
  - [ArrayRes](https://developer.android.com/reference/android/support/annotation/ArrayRes)
  - [AttrRes](https://developer.android.com/reference/android/support/annotation/AttrRes)
  - [BinderThread](https://developer.android.com/reference/android/support/annotation/BinderThread)
  - [BoolRes](https://developer.android.com/reference/android/support/annotation/BoolRes)
  - [CallSuper](https://developer.android.com/reference/android/support/annotation/CallSuper)
  - [CheckResult](https://developer.android.com/reference/android/support/annotation/CheckResult)
  - [ColorInt](https://developer.android.com/reference/android/support/annotation/ColorInt)
  - [ColorLong](https://developer.android.com/reference/android/support/annotation/ColorLong)
  - [ColorRes](https://developer.android.com/reference/android/support/annotation/ColorRes)
  - [DimenRes](https://developer.android.com/reference/android/support/annotation/DimenRes)
  - [Dimension](https://developer.android.com/reference/android/support/annotation/Dimension)
  - [DrawableRes](https://developer.android.com/reference/android/support/annotation/DrawableRes)
  - [FloatRange](https://developer.android.com/reference/android/support/annotation/FloatRange)
  - [FontRes](https://developer.android.com/reference/android/support/annotation/FontRes)
  - [FractionRes](https://developer.android.com/reference/android/support/annotation/FractionRes)
  - [GuardedBy](https://developer.android.com/reference/android/support/annotation/GuardedBy)
  - [HalfFloat](https://developer.android.com/reference/android/support/annotation/HalfFloat)
  - [IdRes](https://developer.android.com/reference/android/support/annotation/IdRes)
  - [IntDef](https://developer.android.com/reference/android/support/annotation/IntDef)
  - [IntegerRes](https://developer.android.com/reference/android/support/annotation/IntegerRes)
  - [InterpolatorRes](https://developer.android.com/reference/android/support/annotation/InterpolatorRes)
  - [IntRange](https://developer.android.com/reference/android/support/annotation/IntRange)
  - [Keep](https://developer.android.com/reference/android/support/annotation/Keep)
  - [LayoutRes](https://developer.android.com/reference/android/support/annotation/LayoutRes)
  - [LongDef](https://developer.android.com/reference/android/support/annotation/LongDef)
  - [MainThread](https://developer.android.com/reference/android/support/annotation/MainThread)
  - [MenuRes](https://developer.android.com/reference/android/support/annotation/MenuRes)
  - [NavigationRes](https://developer.android.com/reference/android/support/annotation/NavigationRes)
  - [NonNull](https://developer.android.com/reference/android/support/annotation/NonNull)
  - [Nullable](https://developer.android.com/reference/android/support/annotation/Nullable)
  - [PluralsRes](https://developer.android.com/reference/android/support/annotation/PluralsRes)
  - [Px](https://developer.android.com/reference/android/support/annotation/Px)
  - [RawRes](https://developer.android.com/reference/android/support/annotation/RawRes)
  - [RequiresApi](https://developer.android.com/reference/android/support/annotation/RequiresApi)
  - [RequiresPermission](https://developer.android.com/reference/android/support/annotation/RequiresPermission)
  - [RequiresPermission.Read](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Read)
  - [RequiresPermission.Write](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Write)
  - [RestrictTo](https://developer.android.com/reference/android/support/annotation/RestrictTo)
  - [Size](https://developer.android.com/reference/android/support/annotation/Size)
  - [StringDef](https://developer.android.com/reference/android/support/annotation/StringDef)
  - [StringRes](https://developer.android.com/reference/android/support/annotation/StringRes)
  - [StyleableRes](https://developer.android.com/reference/android/support/annotation/StyleableRes)
  - [StyleRes](https://developer.android.com/reference/android/support/annotation/StyleRes)
  - [TransitionRes](https://developer.android.com/reference/android/support/annotation/TransitionRes)
  - [UiThread](https://developer.android.com/reference/android/support/annotation/UiThread)
  - [VisibleForTesting](https://developer.android.com/reference/android/support/annotation/VisibleForTesting)
  - [WorkerThread](https://developer.android.com/reference/android/support/annotation/WorkerThread)
  - [XmlRes](https://developer.android.com/reference/android/support/annotation/XmlRes)
-

  ## Enums

  - [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)