Stay organized with collections
Save and categorize content based on your preferences.
Results
object
Results
Direct use of Results
is not supported.
Helper functions to create common formats of Result
.
Summary
Result
Returns a Result
with a resultCode
of ERROR
and a specified errorCode
.
Result
A Result
with a resultCode
of CANCELLED
.
Result
A Result
with a resultCode
of ERROR
with an errorCode
of UNKNOWN
.
Result
A Result
with a resultCode
of SUCCESS
.
Public methods
forError
fun
forError
(
errorCode
:
ErrorCode
)
:
Result
Returns a Result
with a resultCode
of ERROR
and a specified errorCode
.
Properties
CANCELLED
val
CANCELLED
:
Result
A Result
with a resultCode
of CANCELLED
.
ERROR_UNKNOWN
val
ERROR_UNKNOWN
:
Result
A Result
with a resultCode
of ERROR
with an errorCode
of UNKNOWN
.
SUCCESS
val
SUCCESS
:
Result
A Result
with a resultCode
of SUCCESS
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eResults\u003c/code\u003e object provides helper functions to create common formats of \u003ccode\u003eResult\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDirect use of \u003ccode\u003eResults\u003c/code\u003e is not supported, instead utilize provided helper functions and properties.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eforError()\u003c/code\u003e function creates a \u003ccode\u003eResult\u003c/code\u003e with a specific error code.\u003c/p\u003e\n"],["\u003cp\u003ePredefined \u003ccode\u003eResult\u003c/code\u003e properties include \u003ccode\u003eCANCELLED\u003c/code\u003e, \u003ccode\u003eERROR_UNKNOWN\u003c/code\u003e, and \u003ccode\u003eSUCCESS\u003c/code\u003e for convenience.\u003c/p\u003e\n"]]],["The `Results` object, not for direct use, provides helper functions to create `Result` formats. `forError` generates a `Result` with an `ERROR` `resultCode` and a given `errorCode`. `CANCELLED`, `ERROR_UNKNOWN`, and `SUCCESS` are predefined `Result` instances. `CANCELLED` has a `CANCELLED` `resultCode`, `ERROR_UNKNOWN` has an `ERROR` `resultCode` and `UNKNOWN` `errorCode`, and `SUCCESS` has a `SUCCESS` `resultCode`. These functions help build standardized results with relevant codes.\n"],null,["# Results\n=======\n\n```\nobject Results\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [com.google.android.gms.dtdi.analytics.Results](#) |\n\nDirect use of `Results` is not supported.\n\nHelper functions to create common formats of [Result](#).\n\nSummary\n-------\n\n| ### Public methods ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Result | [forError](#forError(com.google.ambient.dtdi.logs.proto.ClientLogEnums.ErrorCode))`(`errorCode:` `ErrorCode`)` Returns a [Result](#) with a `resultCode` of `ERROR` and a specified `errorCode`. |\n\n| ### Properties ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Result | [CANCELLED](#CANCELLED:com.google.ambient.dtdi.logs.proto.ClientLogProtos.Result) A [Result](#) with a `resultCode` of `CANCELLED`. |\n| Result | [ERROR_UNKNOWN](#ERROR_UNKNOWN:com.google.ambient.dtdi.logs.proto.ClientLogProtos.Result) A [Result](#) with a `resultCode` of `ERROR` with an `errorCode` of `UNKNOWN`. |\n| Result | [SUCCESS](#SUCCESS:com.google.ambient.dtdi.logs.proto.ClientLogProtos.Result) A [Result](#) with a `resultCode` of `SUCCESS`. |\n\nPublic methods\n--------------\n\n### forError\n\n```\nfun forError(errorCode: ErrorCode): Result\n```\n\nReturns a [Result](#) with a `resultCode` of `ERROR` and a specified `errorCode`.\n\nProperties\n----------\n\n### CANCELLED\n\n```\nval CANCELLED: Result\n```\n\nA [Result](#) with a `resultCode` of `CANCELLED`. \n\n### ERROR_UNKNOWN\n\n```\nval ERROR_UNKNOWN: Result\n```\n\nA [Result](#) with a `resultCode` of `ERROR` with an `errorCode` of `UNKNOWN`. \n\n### SUCCESS\n\n```\nval SUCCESS: Result\n```\n\nA [Result](#) with a `resultCode` of `SUCCESS`."]]