Package org.apache.unomi.api.actions
Class Action
java.lang.Object
org.apache.unomi.api.actions.Action
- All Implemented Interfaces:
Serializable
An action that can be executed as a consequence of a
Rule
being triggered. An action is characterized by its associated ActionType
and parameter values.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAction()
Instantiates a new Action.Action
(ActionType actionType) Instantiates a new Action with the specifiedActionType
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the action's type.Retrieves the identifier of the associated action type.Retrieves the parameter values as a Map of parameter name - associated value pairs.void
setActionType
(ActionType actionType) Sets the action's type.void
setActionTypeId
(String actionTypeId) Sets the identifier of the associated action type.void
setParameter
(String name, Object value) Sets the parameter identified by the specified name to the specified value.void
setParameterValues
(Map<String, Object> parameterValues) Sets the parameter values as a Map of parameter name - associated value pairs.
-
Constructor Details
-
Action
public Action()Instantiates a new Action. -
Action
Instantiates a new Action with the specifiedActionType
- Parameters:
actionType
- the action's type
-
-
Method Details
-
getActionType
Retrieves the action's type.- Returns:
- the action's type
-
setActionType
Sets the action's type.- Parameters:
actionType
- the action's type
-
getActionTypeId
Retrieves the identifier of the associated action type.- Returns:
- the identifier of the associated action type
-
setActionTypeId
Sets the identifier of the associated action type.- Parameters:
actionTypeId
- the identifier of the associated action type
-
getParameterValues
Retrieves the parameter values as a Map of parameter name - associated value pairs.- Returns:
- a Map of parameter name - associated value pairs
-
setParameterValues
Sets the parameter values as a Map of parameter name - associated value pairs.- Parameters:
parameterValues
- the parameter values as a Map of parameter name - associated value pairs
-
setParameter
Sets the parameter identified by the specified name to the specified value. If a parameter with that name already exists, replaces its value, otherwise adds the new parameter with the specified name and value.- Parameters:
name
- the name of the parameter to setvalue
- the value of the parameter
-