ActionResult.Builder Class

Contains methods to build and validate an instance of the Messaging.ActionResult class.

Namespace

Messaging

Usage

See the example for the NotificationActionHandler Interface.

ActionResult.Builder Methods

The following are methods for ActionResult.Builder.

build()

Validates and returns the action result instance created by using the ActionResult.Builder methods.

Signature

public Messaging.ActionResult build()

Return Value

Type: Messaging.ActionResult

withErrorCode(errorCode)

Sets the error message associated with the action error.

Signature

public Messaging.ActionResult.Builder withErrorCode(Messaging.ActionError errorCode)

Parameters

errorCode
Type: Messaging.ActionError
The error message.

Return Value

Type: Messaging.ActionResult.Builder

withMessage(message)

Sets the success or error message associated with the execution of the action.

Signature

public Messaging.ActionResult.Builder withMessage(String message)

Parameters

message
Type: String
The notification message.

Return Value

Type: Messaging.ActionResult.Builder

withSuccess(success)

Sets a Boolean that informs the user whether the execution of the action was successful (true) or not (false).

Signature

public Messaging.ActionResult.Builder withSuccess(Boolean success)

Parameters

success
Type: Boolean

Return Value

Type: Messaging.ActionResult.Builder