com.android.ide.common.rendering.api
Class Result

java.lang.Object
  extended by com.android.ide.common.rendering.api.Result

public class Result
extends java.lang.Object

Scene result class. This is an immutable class.

This cannot be allocated directly, instead use Result.Status.createResult(), Result.Status.createResult(String, Throwable), Result.Status.createResult(String) Result.Status.createResult(Object)


Nested Class Summary
static class Result.Status
          Scene Status enum.
 
Method Summary
 Result getCopyWithData(java.lang.Object data)
          Returns a copy of the current result with the added (or replaced) given data
 java.lang.Object getData()
          Returns the optional data bundle stored in the result object.
 java.lang.String getErrorMessage()
          Returns the error message.
 java.lang.Throwable getException()
          Returns the exception.
 Result.Status getStatus()
          Returns the status.
 boolean isSuccess()
          Returns whether the status is successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCopyWithData

public Result getCopyWithData(java.lang.Object data)
Returns a copy of the current result with the added (or replaced) given data

Parameters:
data - the data bundle
Returns:
returns a new SceneResult instance.

isSuccess

public boolean isSuccess()
Returns whether the status is successful.

This is the same as calling getStatus() == SceneStatus.SUCCESS

Returns:
true if the status is successful.

getStatus

public Result.Status getStatus()
Returns the status. This is never null.


getErrorMessage

public java.lang.String getErrorMessage()
Returns the error message. This is only non-null when getStatus() returns Result.Status.ERROR_UNKNOWN


getException

public java.lang.Throwable getException()
Returns the exception. This is only non-null when getStatus() returns Result.Status.ERROR_UNKNOWN


getData

public java.lang.Object getData()
Returns the optional data bundle stored in the result object.

Returns:
the data bundle or null if none have been set.