Builder
class Builder
| kotlin.Any | |
| ↳ | android.service.personalcontext.understander.UnderstandResult.Builder |
Builder for creating an UnderstandResult.
Summary
| Public constructors | |
|---|---|
Builder(request: UnderstandRequest)Creates a new builder for an |
|
| Public methods | |
|---|---|
| UnderstandResult |
build()Builds and returns a new |
| UnderstandResult.Builder |
setFeedbackActivity(feedbackActivity: PendingIntent?)Sets the |
| UnderstandResult.Builder |
setResponseForDestination(destination: Int, insight: ContextInsight)Sets the response insight for the given destination. |
| UnderstandResult.Builder |
setVisualizerSession(session: InsightVisualizerSession?)Sets an |
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 |