Class App.Result
On this page
io.realm.mongodb
Enclosing class:
Result class representing the result of an async request from this app towards MongoDB Realm.
Method Summary
Modifier and Type | Method and Description |
---|---|
public T | get () Returns the response in case the request was a success. |
public AppException | getError () Returns the error in case of a failed request. |
public T | Returns the response if the request was a success. |
public T | getOrThrow () If the request was successful the response is returned, otherwise the provided error is thrown. |
public boolean | isSuccess () Returns whether or not request was successful |
public static App.Result | success <T >() Creates a successful request result with no return value. |
public static App.Result | Creates a failed request result. |
public static App.Result | Creates a successful request result with a return value. |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass
,hashCode
,equals
,clone
,toString
,notify
,notifyAll
,wait
,wait
,wait
,finalize
Method Detail
get
public T get () |
---|
Returns the response in case the request was a success. Returns the response value in case of a successful request. |
getError
public AppException getError () |
---|
getOrDefault
Returns the response if the request was a success. If it failed, the default value is returned instead. Returns the response value in case of a successful request. If the request failed, the default value is returned instead. |
getOrThrow
public T getOrThrow () |
---|
If the request was successful the response is returned, otherwise the provided error is thrown. Returns the response object in case the request was a success. Throws
|
isSuccess
public boolean isSuccess () |
---|
Returns whether or not request was successful Returns
|
success
public static App.Result success <T >() |
---|
Creates a successful request result with no return value. |
withError
Creates a failed request result. The request failed for some reason, either because there was a network error or the Realm Object Server returned an error. Parameters
|
withResult
Creates a successful request result with a return value. Parameters
|