| <html devsite="true"> |
| <head> |
| <title>RestrictTo</title> |
| {% setvar book_path %}/reference/kotlin/dokkatest/_book.yaml{% endsetvar %} |
| {% include "_shared/_reference-head-tags.html" %} |
| </head> |
| <body> |
| <div id="metadata-info-block"></div> |
| <h1>RestrictTo</h1> |
| <p> |
| <pre>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-must-be-documented/index.html">MustBeDocumented</a><br>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-retention/index.html">Retention</a>(value = AnnotationRetention.BINARY)<br>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-target/index.html">Target</a>(allowedTargets = [AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD, AnnotationTarget.FILE])<br>@<a href="https://developer.android.com/reference/java/lang/annotation/Target.html">Target</a>(value = [ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE])<br>annotation <a href="/reference/kotlin/androidx/annotation/RestrictTo.html">RestrictTo</a></pre> |
| </p> |
| <hr> |
| <p>Denotes that the annotated element should only be accessed from within a specific scope (as defined by <code><a href="/reference/kotlin/androidx/annotation/RestrictTo.Scope.html">Scope</a></code>).</p> |
| <p>Example of restricting usage within a library (based on gradle group ID):</p> |
| <pre class="prettyprint">@RestrictTo(GROUP_ID)<br>public void resetPaddingToInitialValues() { ...</pre> |
| <p>Example of restricting usage to tests:</p> |
| <pre class="prettyprint">@RestrictTo(Scope.TESTS)<br>public abstract int getUserId();</pre> |
| <p>Example of restricting usage to subclasses:</p> |
| <pre class="prettyprint">@RestrictTo(Scope.SUBCLASSES)<br>public void onDrawForeground(Canvas canvas) { ...</pre> |
| <h2>Summary</h2> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Nested types</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>enum <a href="/reference/kotlin/androidx/annotation/RestrictTo.Scope.html">RestrictTo.Scope</a> : <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">Enum</a></code></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public constructors</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td> |
| <div><code><a href="/reference/kotlin/androidx/annotation/RestrictTo.html#RestrictTo(kotlin.Array)">RestrictTo</a>(vararg value: <a href="/reference/kotlin/androidx/annotation/RestrictTo.Scope.html">RestrictTo.Scope</a>)</code></div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public properties</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a><<a href="/reference/kotlin/androidx/annotation/RestrictTo.Scope.html">RestrictTo.Scope</a>></code></td> |
| <td> |
| <div><code><a href="/reference/kotlin/androidx/annotation/RestrictTo.html#value()">value</a></code></div> |
| <p>The scope to which usage should be restricted.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <h2>Public constructors</h2> |
| <div><a name="RestrictTo-kotlin.Array-"></a><a name="restrictto"></a> |
| <h3 class="api-name" id="RestrictTo(kotlin.Array)">RestrictTo</h3> |
| <pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/annotation/RestrictTo.html#RestrictTo(kotlin.Array)">RestrictTo</a>(vararg value: <a href="/reference/kotlin/androidx/annotation/RestrictTo.Scope.html">RestrictTo.Scope</a>)</pre> |
| </div> |
| <h2>Public properties</h2> |
| <div><a name="getValue()"></a><a name="setValue()"></a><a name="getValue--"></a><a name="setValue--"></a> |
| <h3 class="api-name" id="value()">value</h3> |
| <pre class="api-signature no-pretty-print">val <a href="/reference/kotlin/androidx/annotation/RestrictTo.html#value()">value</a>: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a><<a href="/reference/kotlin/androidx/annotation/RestrictTo.Scope.html">RestrictTo.Scope</a>></pre> |
| <p>The scope to which usage should be restricted.</p> |
| </div> |
| </body> |
| </html> |