Package zendesk.answerbot
Class AnswerBotActionHandler
- java.lang.Object
-
- zendesk.answerbot.AnswerBotActionHandler
-
- All Implemented Interfaces:
- ActionHandler
public final class AnswerBotActionHandler extends java.lang.Object implements ActionHandler
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
canHandle(java.lang.String actionName)
Determines whether or not the ActionHandler object can handle the given action String.ActionDescription
getActionDescription()
int
getPriority()
Returns the priority of the ActionHandler.void
handle(java.util.Map<java.lang.String,java.lang.Object> data, Context context)
Invokes an action on the given action String.void
updateSettings(java.util.Map<java.lang.String,JsonElement> rawSettings)
Notifies the ActionHandler of an update to settings.
-
-
-
Method Detail
-
canHandle
public boolean canHandle(java.lang.String actionName)
Description copied from interface:ActionHandler
Determines whether or not the ActionHandler object can handle the given action String.- Specified by:
canHandle
in interfaceActionHandler
- Parameters:
actionName
- the action String to check against.- Returns:
- true if the action String can be handled, false if it can't.
-
handle
public void handle(java.util.Map<java.lang.String,java.lang.Object> data, Context context)
Description copied from interface:ActionHandler
Invokes an action on the given action String. This is expected to be the starting of an Activity, hence theContext
parameter.This method can be called before init for a given SDK is performed so you need to check if any SDK's called here are initialised before any action takes place.
- Specified by:
handle
in interfaceActionHandler
- Parameters:
data
- an optional map of key-value pairs for theActionHandler
to use in handling the action.context
- theContext
to use in invoking the action, such as starting an Activity.
-
getPriority
public int getPriority()
Description copied from interface:ActionHandler
Returns the priority of the ActionHandler. The higher the number, the higher the priority.- Specified by:
getPriority
in interfaceActionHandler
- Returns:
- the priority of the ActionHandler.
-
getActionDescription
public ActionDescription getActionDescription()
- Specified by:
getActionDescription
in interfaceActionHandler
- Returns:
- a description for this action.
-
updateSettings
public void updateSettings(java.util.Map<java.lang.String,JsonElement> rawSettings)
Description copied from interface:ActionHandler
Notifies the ActionHandler of an update to settings. These settings allows the ActionHandler to determine whether they should be enabled. This will contain settings for each of the SDKs enabled for this account. Each ActionHandler should extract the settings object relating to its specific SDK and only store that.- Specified by:
updateSettings
in interfaceActionHandler
- Parameters:
rawSettings
- a map representing the SDK settings for the current instance.
-
-