| <html devsite="true"> |
| <head> |
| <title>CheckResult</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="CheckResult"> |
| <meta itemprop="path" content="androidx.annotation"> |
| <meta itemprop="property" content="getSuggest()"> |
| <meta itemprop="language" content="JAVA"> |
| </div> |
| <div id="header-block"> |
| <div> |
| <h1>CheckResult</h1> |
| </div> |
| <div id="metadata-info-block"> |
| <div id="source-link"><a href="https://cs.android.com/search?q=file:androidx/annotation/CheckResult.kt+class:androidx.annotation.CheckResult&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/-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.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER])<br>public annotation <a href="/reference/androidx/annotation/CheckResult.html">CheckResult</a></pre> |
| </p> |
| <hr> |
| <p>Denotes that the annotated method returns a result that it typically is an error to ignore. This is usually used for methods that have no side effect, so calling it without actually looking at the result usually means the developer has misunderstood what the method does.</p> |
| <p>Example:</p> |
| <pre class="prettyprint">public @CheckResult String trim(String s) { return s.trim(); }<br>...<br>s.trim(); // this is probably an error<br>s = s.trim(); // ok</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/CheckResult.html#CheckResult(kotlin.String)">CheckResult</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a> suggest)</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/CheckResult.html#getSuggest()">getSuggest</a>()</code></div> |
| <p>Defines the name of the suggested method to use instead, if applicable (using the same signature format as javadoc.) If there is more than one possibility, list them all separated by commas.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="list"> |
| <h2>Public constructors</h2> |
| <div class="api-item"><a name="CheckResult-kotlin.String-"></a><a name="checkresult"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="CheckResult(kotlin.String)">CheckResult</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public <a href="/reference/androidx/annotation/CheckResult.html#CheckResult(kotlin.String)">CheckResult</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a> suggest)</pre> |
| </div> |
| </div> |
| <div class="list"> |
| <h2>Public methods</h2> |
| <div class="api-item"><a name="getSuggest--"></a><a name="getsuggest"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="getSuggest()">getSuggest</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/CheckResult.html#getSuggest()">getSuggest</a>()</pre> |
| <p>Defines the name of the suggested method to use instead, if applicable (using the same signature format as javadoc.) If there is more than one possibility, list them all separated by commas.</p> |
| <p>For example, ProcessBuilder has a method named <code>redirectErrorStream()</code> which sounds like it might redirect the error stream. It does not. It's just a getter which returns whether the process builder will redirect the error stream, and to actually set it, you must call <code>redirectErrorStream(boolean)</code>. In that case, the method should be defined like this:</p> |
| <pre class="prettyprint">@CheckResult(suggest="#redirectErrorStream(boolean)")<br>public boolean redirectErrorStream() { ... }</pre> |
| </div> |
| </div> |
| </body> |
| </html> |