ActionResult.Builder Class
Contains methods to build and validate an instance of the Messaging.ActionResult class.
See the example for the NotificationActionHandler Interface.
The following are methods for ActionResult.Builder.
-
Validates and returns the action result instance created by using the
ActionResult.Buildermethods. -
Sets the error message associated with the action error.
-
Sets the success or error message associated with the execution of the action.
-
Sets a Boolean that informs the user whether the execution of the action was successful (
true) or not (false).
Validates and returns the action result instance created by using the ActionResult.Builder methods.
public Messaging.ActionResult build()
Type: Messaging.ActionResult
Sets the error message associated with the action error.
public Messaging.ActionResult.Builder withErrorCode(Messaging.ActionError errorCode)
-
errorCode:
Type: Messaging.ActionError
The error message.
Type: Messaging.ActionResult.Builder
Sets the success or error message associated with the execution of the action.
public Messaging.ActionResult.Builder withMessage(String message)
-
message:
Type: String
The notification message.
Type: Messaging.ActionResult.Builder
Sets a Boolean that informs the user whether the execution of the action was successful (true) or not (false).
public Messaging.ActionResult.Builder withSuccess(Boolean success)
-
success:
Type: Boolean