com.h3c.api

## Class Result<D,E,C>

- java.lang.Object
- - com.h3c.api.Result<D,E,C>

- Type Parameters:
    `D` - type of the result data.
    `E` - type of the error.
    `C` - type of the cancellation cause.
  All Implemented Interfaces:
    Serializable

      public class Result<D,E,C>
      extends Object
      implements Serializable

  Result.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Result.CompletionState` Completion State.

  - ### Method Summary

    Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### createSuccessResult

          public static <D,E,C> Result<D,E,C> createSuccessResult()

      Creates a success result with no result data.
      Returns:
        a success result.

    - #### createSuccessResult

          public static <D,E,C> Result<D,E,C> createSuccessResult(D resultData)

      Creates a success result.
      Parameters:
        `resultData` - result data.
      Returns:
        a success result.

    - #### createFailureResult

          public static <D,E,C> Result<D,E,C> createFailureResult(E error)

      Creates a failure result.
      Parameters:
        `error` - error.
      Returns:
        a failure result.

    - #### createCanceledResult

          public static <D,E,C> Result<D,E,C> createCanceledResult(C cause)

      Creates a canceled result.
      Parameters:
        `cause` - cancellation cause.
      Returns:
        a result for an operation that was canceled.

    - #### getCompletionState

          public Result.CompletionState getCompletionState()

      Gets the completion state.
      Returns:
        the completion state.

    - #### getResultData

          public D getResultData()

      Gets the result data.
      Returns:
        the result data.

    - #### getError

          public E getError()

      Gets the error.
      Returns:
        the error.

    - #### getCancellationCause

          public C getCancellationCause()

      Gets the cancellation cause.
      Returns:
        the cancellation cause.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014. All Rights Reserved.