public abstract class BaasResult<T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> BaasResult<T> |
cancel()
Returns a new canceled BaasResult
|
abstract BaasException |
error()
Returns the error represented by this result
or null if this result is not an error.
|
static <T> BaasResult<T> |
failure(BaasException t)
Returns a new failed BaasResult
|
abstract T |
get()
Tries to return the value if there was an error
it will be thrown instead.
|
abstract boolean |
isCanceled()
True if this result represent a cancelled request
|
abstract boolean |
isFailed()
True if this result represents a failure
|
abstract boolean |
isSuccess()
True if the result represent a success
|
static <T> BaasResult<T> |
success(T result)
Returns a new successful BaasResult
|
abstract T |
value()
Returns the value represented by this result
if there was no error, null otherwise
|
public static <T> BaasResult<T> failure(BaasException t)
T
- t
- public static <T> BaasResult<T> cancel()
T
- public static <T> BaasResult<T> success(T result)
T
- result
- public abstract BaasException error()
BaasException
public abstract T get() throws BaasException
BaasException
- if the request was canceled or there was an errrorpublic abstract boolean isCanceled()
public abstract boolean isFailed()
public abstract boolean isSuccess()
public abstract T value()