UnderstandResult.Builder
public
static
final
class
UnderstandResult.Builder
extends Object
| java.lang.Object | |
| ↳ | android.service.personalcontext.understander.UnderstandResult.Builder |
Builder for creating an UnderstandResult.
Summary
Public constructors | |
|---|---|
Builder(UnderstandRequest request)
Creates a new builder for an |
|
Public methods | |
|---|---|
UnderstandResult
|
build()
Builds and returns a new |
UnderstandResult.Builder
|
setFeedbackActivity(PendingIntent feedbackActivity)
Sets the |
UnderstandResult.Builder
|
setResponseForDestination(int destination, ContextInsight insight)
Sets the response insight for the given destination. |
UnderstandResult.Builder
|
setVisualizerSession(InsightVisualizerSession session)
Sets an |
Inherited methods | |
|---|---|
Public constructors
Builder
public Builder (UnderstandRequest request)
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
public UnderstandResult build ()
Builds and returns a new UnderstandResult instance.
| Returns | |
|---|---|
UnderstandResult |
a new UnderstandResult instance.
This value cannot be null. |
setFeedbackActivity
public UnderstandResult.Builder setFeedbackActivity (PendingIntent feedbackActivity)
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. |
| Returns | |
|---|---|
UnderstandResult.Builder |
This value cannot be null. |
setResponseForDestination
public UnderstandResult.Builder setResponseForDestination (int destination, ContextInsight insight)
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. |
| Returns | |
|---|---|
UnderstandResult.Builder |
this Builder instance.
This value cannot be null. |
| Throws | |
|---|---|
IllegalArgumentException |
if an insight was not requested for the given destination |
setVisualizerSession
public UnderstandResult.Builder setVisualizerSession (InsightVisualizerSession session)
Sets an InsightVisualizerSession to provide interactive visualizations to a
client app.
This is only allowed when ERROR(PersonalContextManager.DESTINATION_EMBEDDED/android.service.personalcontext.PersonalContextManager#DESTINATION_EMBEDDED 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. |
| Returns | |
|---|---|
UnderstandResult.Builder |
this Builder instance.
This value cannot be null. |