| <html devsite="true"> |
| <head> |
| <title>Discouraged</title> |
| {% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} |
| {% include "_shared/_reference-head-tags.html" %} |
| </head> |
| <body> |
| <div itemscope="" itemtype="http://developers.google.com/ReferenceObject"> |
| <meta itemprop="name" content="Discouraged"> |
| <meta itemprop="path" content="androidx.annotation"> |
| <meta itemprop="property" content="getMessage()"> |
| <meta itemprop="language" content="JAVA"> |
| </div> |
| <div id="header-block"> |
| <div> |
| <h1>Discouraged</h1> |
| </div> |
| <div id="metadata-info-block"> |
| <div id="source-link"><a href="https://cs.android.com/search?q=file:androidx/annotation/Discouraged.kt+class:androidx.annotation.Discouraged&ss=androidx/platform/frameworks/support" class="external">View Source</a></div> |
| </div> |
| </div> |
| <div id="refdoc-switcher-placeholder"></div> |
| <p> |
| <pre>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-retention/index.html">Retention</a>(value = AnnotationRetention.SOURCE)<br>@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.annotation/-target/index.html">Target</a>(allowedTargets = [AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS])<br>public annotation <a href="/reference/androidx/annotation/Discouraged.html">Discouraged</a></pre> |
| </p> |
| <hr> |
| <p>Denotes that the annotated element, while not disallowed or deprecated, is one that programmers are generally discouraged from using.</p> |
| <p>Example:</p> |
| <pre class="prettyprint">@Discouraged(message = "It is much more efficient to retrieve "<br> + "resources by identifier than by name.")<br>public void getValue(String name) {<br> ...<br>}</pre> |
| <h2>Summary</h2> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public constructors</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td> |
| <div><code><a href="/reference/androidx/annotation/Discouraged.html#Discouraged(kotlin.String)">Discouraged</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a> message)</code></div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public methods</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a></code></td> |
| <td> |
| <div><code><a href="/reference/androidx/annotation/Discouraged.html#getMessage()">getMessage</a>()</code></div> |
| <p>Defines the message to display when an element marked with this annotation is used.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="list"> |
| <h2>Public constructors</h2> |
| <div class="api-item"><a name="Discouraged-kotlin.String-"></a><a name="discouraged"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="Discouraged(kotlin.String)">Discouraged</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public <a href="/reference/androidx/annotation/Discouraged.html#Discouraged(kotlin.String)">Discouraged</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a> message)</pre> |
| </div> |
| </div> |
| <div class="list"> |
| <h2>Public methods</h2> |
| <div class="api-item"><a name="getMessage--"></a><a name="getmessage"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="getMessage()">getMessage</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a> <a href="/reference/androidx/annotation/Discouraged.html#getMessage()">getMessage</a>()</pre> |
| <p>Defines the message to display when an element marked with this annotation is used. An alternative should be provided in the message.</p> |
| </div> |
| </div> |
| </body> |
| </html> |