Builder


class Builder
kotlin.Any
   ↳ android.service.personalcontext.understander.UnderstandResult.Builder

Builder for creating an UnderstandResult.

Summary

Public constructors

Creates a new builder for an UnderstandResult for the given request.

Public methods
UnderstandResult

Builds and returns a new UnderstandResult instance.

UnderstandResult.Builder
setFeedbackActivity(feedbackActivity: PendingIntent?)

Sets the PendingIntent that can be used to launch the feedback activity.

UnderstandResult.Builder
setResponseForDestination(destination: Int, insight: ContextInsight)

Sets the response insight for the given destination.

UnderstandResult.Builder

Sets an InsightVisualizerSession to provide interactive visualizations to a client app.

Public constructors

Builder

Builder(request: UnderstandRequest)

Creates a new builder for an UnderstandResult for the given request.

Parameters
request UnderstandRequest: the request for which an understand result is being built.
This value cannot be null.

Public methods

build

fun build(): UnderstandResult

Builds and returns a new UnderstandResult instance.

Return
UnderstandResult a new UnderstandResult instance.
This value cannot be null.

setFeedbackActivity

fun setFeedbackActivity(feedbackActivity: PendingIntent?): UnderstandResult.Builder

Sets the PendingIntent that can be used to launch the feedback activity.

This activity will be used for feedback for all insights or embedded visualizations displayed from this request.

Parameters
feedbackActivity PendingIntent?: This value may be null.
Return
UnderstandResult.Builder This value cannot be null.

See Also

    setResponseForDestination

    fun setResponseForDestination(
        destination: Int,
        insight: ContextInsight
    ): UnderstandResult.Builder

    Sets the response insight for the given destination.

    Up to one insight can be provided for each destination.

    Parameters
    destination Int: single destination for which an insight is being provided
    insight ContextInsight: generated insight to provide to that destination.
    This value cannot be null.
    Return
    UnderstandResult.Builder this Builder instance.
    This value cannot be null.
    Exceptions
    java.lang.IllegalArgumentException if an insight was not requested for the given destination

    setVisualizerSession

    fun setVisualizerSession(session: InsightVisualizerSession?): UnderstandResult.Builder

    Sets an InsightVisualizerSession to provide interactive visualizations to a client app.

    This is only allowed when PersonalContextManager.DESTINATION_EMBEDDED was requested in the UnderstandRequest.

    Parameters
    session InsightVisualizerSession?: the visualization session to handle requests for this client.
    This value may be null.
    Return
    UnderstandResult.Builder this Builder instance.
    This value cannot be null.
    Exceptions
    java.lang.IllegalArgumentException if PersonalContextManager.DESTINATION_EMBEDDED was not requested