D
- type of the result data.E
- type of the error.C
- type of the cancellation cause.public class Result<D,E,C> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Result.CompletionState
Completion State.
|
Modifier and Type | Method and Description |
---|---|
static <D,E,C> Result<D,E,C> |
createCanceledResult(C cause)
Creates a canceled result.
|
static <D,E,C> Result<D,E,C> |
createFailureResult(E error)
Creates a failure result.
|
static <D,E,C> Result<D,E,C> |
createSuccessResult()
Creates a success result with no result data.
|
static <D,E,C> Result<D,E,C> |
createSuccessResult(D resultData)
Creates a success result.
|
C |
getCancellationCause()
Gets the cancellation cause.
|
Result.CompletionState |
getCompletionState()
Gets the completion state.
|
E |
getError()
Gets the error.
|
D |
getResultData()
Gets the result data.
|
String |
toString() |
public static <D,E,C> Result<D,E,C> createSuccessResult()
public static <D,E,C> Result<D,E,C> createSuccessResult(D resultData)
resultData
- result data.public static <D,E,C> Result<D,E,C> createFailureResult(E error)
error
- error.public static <D,E,C> Result<D,E,C> createCanceledResult(C cause)
cause
- cancellation cause.public Result.CompletionState getCompletionState()
public D getResultData()
public E getError()
public C getCancellationCause()
Copyright © 2015. All Rights Reserved.