public final class

ActionResult

extends Object
java.lang.Object
   ↳ com.urbanairship.actions.ActionResult

Class Overview

Stores the results of running an Action.

Summary

Nested Classes
@interface ActionResult.Status  
Constants
int STATUS_ACTION_NOT_FOUND The action was not performed because the action was not found in the ActionRegistry.
int STATUS_COMPLETED The action accepted the arguments and executed without an exception.
int STATUS_EXECUTION_ERROR The action encountered a runtime exception during execution.
int STATUS_REJECTED_ARGUMENTS The action was not performed because the arguments were rejected by either the predicate in the registry or the action.
Public Methods
Exception getException()
Retrieves the results exception.
int getStatus()
Retrieves the status of the action run.
ActionValue getValue()
Retrieves the result value.
static ActionResult newEmptyResult()
Factory method to create an empty result
static ActionResult newErrorResult(Exception exception)
Factory method to create a result with an exception
static ActionResult newResult(ActionValue value)
Factory method to create a result with a value
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int STATUS_ACTION_NOT_FOUND

The action was not performed because the action was not found in the ActionRegistry. This value is only possible if trying to run an action by name through the ActionRunRequestFactory.

Constant Value: 3 (0x00000003)

public static final int STATUS_COMPLETED

The action accepted the arguments and executed without an exception.

Constant Value: 1 (0x00000001)

public static final int STATUS_EXECUTION_ERROR

The action encountered a runtime exception during execution. The exception field will contain the caught exception.

Constant Value: 4 (0x00000004)

public static final int STATUS_REJECTED_ARGUMENTS

The action was not performed because the arguments were rejected by either the predicate in the registry or the action.

Constant Value: 2 (0x00000002)

Public Methods

public Exception getException ()

Retrieves the results exception.

Returns
  • The result exception.

public int getStatus ()

Retrieves the status of the action run.

Returns
  • The status of the action run.

public ActionValue getValue ()

Retrieves the result value.

Returns
  • The result value as an ActionValue.

public static ActionResult newEmptyResult ()

Factory method to create an empty result

public static ActionResult newErrorResult (Exception exception)

Factory method to create a result with an exception

Parameters
exception The result value

public static ActionResult newResult (ActionValue value)

Factory method to create a result with a value

Parameters
value The result value