Package org.xnio

# Class TranslatingResult<T,O>

java.lang.Object
org.xnio.TranslatingResult<T,O>

Type Parameters:
  `T` - the result type to accept
  `O` - the result type to pass to the delegate

All Implemented Interfaces:
  `Result<T>`

public abstract class TranslatingResult<T,O> extends Object implements Result<T>
Abstract base class for `Result`s which translate from one type to another.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`TranslatingResult(Result<O> output)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`setCancelled()`
Acknowledge the cancellation of this operation.
`boolean`
`setException(IOException exception)`
Set the exception for this operation.
`boolean`
`setResult(T result)`
Set the result for this operation.
`protected abstract O`
`translate(T input)`

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

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

## Constructor Details

### TranslatingResult

protected TranslatingResult(Result<O> output)

## Method Details

### setException

public boolean setException(IOException exception)
Description copied from interface: `Result`
Set the exception for this operation. Any threads blocking on this instance will be unblocked.

Specified by:
  `setException` in interface `Result<T>`
Parameters:
  `exception` - the exception to set
Returns:
  `false` if the operation was already completed, `true` otherwise

### setCancelled

public boolean setCancelled()
Description copied from interface: `Result`
Acknowledge the cancellation of this operation.

Specified by:
  `setCancelled` in interface `Result<T>`
Returns:
  `false` if the operation was already completed, `true` otherwise

### setResult

public boolean setResult(T result)
Description copied from interface: `Result`
Set the result for this operation. Any threads blocking on this instance will be unblocked.

Specified by:
  `setResult` in interface `Result<T>`
Parameters:
  `result` - the result to set
Returns:
  `false` if the operation was already completed, `true` otherwise

### translate

protected abstract O translate(T input) throws IOException

Throws:
  `IOException`