Top Description Fields Constructors Methods
org.xnio

public abstract Class TranslatingResult<T, O>

extends Object
implements Result<T>
Class Inheritance
All Implemented Interfaces
org.xnio.Result
Type Parameters
<T>
the result type to accept
<O>
the result type to pass to the delegate
Imports
java.io.IOException

Abstract base class for Results which translate from one type to another.

Field Summary

Modifier and TypeField and Description
private final Result<O>

Constructor Summary

AccessConstructor and Description
protected
TranslatingResult(final Result<O> output)

Method Summary

Modifier and TypeMethod and Description
public boolean
setCancelled()

Implements org.xnio.Result.setCancelled.

Acknowledge the cancellation of this operation.

public boolean
setException(final IOException
the exception to set
exception
)

Implements org.xnio.Result.setException.

Set the exception for this operation.

public boolean
setResult(final T
the result to set
result
)

Implements org.xnio.Result.setResult.

Set the result for this operation.

protected abstract O
translate(T input)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

outputback to summary
private final Result<O> output

Constructor Detail

TranslatingResultback to summary
protected TranslatingResult(final Result<O> output)

Method Detail

setCancelledback to summary
public boolean setCancelled()

Implements org.xnio.Result.setCancelled.

Doc from org.xnio.Result.setCancelled.

Acknowledge the cancellation of this operation.

Returns:boolean

false if the operation was already completed, true otherwise

setExceptionback to summary
public boolean setException(final IOException exception)

Implements org.xnio.Result.setException.

Doc from org.xnio.Result.setException.

Set the exception for this operation. Any threads blocking on this instance will be unblocked.

Parameters
exception:IOException

the exception to set

Returns:boolean

false if the operation was already completed, true otherwise

setResultback to summary
public boolean setResult(final T result)

Implements org.xnio.Result.setResult.

Doc from org.xnio.Result.setResult.

Set the result for this operation. Any threads blocking on this instance will be unblocked.

Parameters
result:T

the result to set

Returns:boolean

false if the operation was already completed, true otherwise

translateback to summary
protected abstract O translate(T input) throws IOException