ExecuteAppFunctionResponse


class ExecuteAppFunctionResponse : Parcelable
kotlin.Any
   ↳ android.app.appfunctions.ExecuteAppFunctionResponse

The response to an app function execution.

Summary

Constants
static String

The name of the property that stores the function return value within the resultDocument.

Inherited constants
Public constructors

Public methods
Int

Bundle

Returns the additional metadata for this function execution response.

GenericDocument

Returns a generic document containing the return value of the executed function.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<ExecuteAppFunctionResponse!>

Constants

PROPERTY_RETURN_VALUE

static val PROPERTY_RETURN_VALUE: String

The name of the property that stores the function return value within the resultDocument.

See GenericDocument.getProperty(String) for more information.

If the function returns void or throws an error, the resultDocument will be empty GenericDocument.

If the resultDocument is empty, GenericDocument.getProperty(String) will return null.

See getResultDocument for more information on extracting the return value.

Value: "androidAppfunctionsReturnValue"

Public constructors

ExecuteAppFunctionResponse

ExecuteAppFunctionResponse(resultDocument: GenericDocument)
Parameters
resultDocument GenericDocument: The return value of the executed function. This value cannot be null.

ExecuteAppFunctionResponse

ExecuteAppFunctionResponse(
    resultDocument: GenericDocument,
    extras: Bundle)
Parameters
resultDocument GenericDocument: The return value of the executed function. This value cannot be null.
extras Bundle: The additional metadata for this function execution response. This value cannot be null.

Public methods

describeContents

fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getExtras

fun getExtras(): Bundle

Returns the additional metadata for this function execution response.

Return
Bundle This value cannot be null.

getResultDocument

fun getResultDocument(): GenericDocument

Returns a generic document containing the return value of the executed function.

The PROPERTY_RETURN_VALUE key can be used to obtain the return value.

Sample code for extracting the return value:

GenericDocument resultDocument = response.getResultDocument();
      Object returnValue = resultDocument.getProperty(PROPERTY_RETURN_VALUE);
      if (returnValue != null) {
        // Cast returnValue to expected type, or use <code><a docref="android.app.appsearch.GenericDocument$getPropertyString(kotlin.String)">GenericDocument.getPropertyString</a></code>,
        // <code><a docref="android.app.appsearch.GenericDocument$getPropertyLong(kotlin.String)">GenericDocument.getPropertyLong</a></code>etc.
        // Do something with the returnValue
      }
  

writeToParcel

fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

static val CREATOR: Parcelable.Creator<ExecuteAppFunctionResponse!>