Package org.xnio
Class TranslatingResult<T,O>
java.lang.Object
org.xnio.TranslatingResult<T,O>
- Type Parameters:
T
- the result type to acceptO
- the result type to pass to the delegate
- All Implemented Interfaces:
Result<T>
Abstract base class for
Result
s which translate from one type to another.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Acknowledge the cancellation of this operation.boolean
setException
(IOException exception) Set the exception for this operation.boolean
Set the result for this operation.protected abstract O
-
Constructor Details
-
TranslatingResult
-
-
Method Details
-
setException
Description copied from interface:Result
Set the exception for this operation. Any threads blocking on this instance will be unblocked.- Specified by:
setException
in interfaceResult<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 interfaceResult<T>
- Returns:
false
if the operation was already completed,true
otherwise
-
setResult
Description copied from interface:Result
Set the result for this operation. Any threads blocking on this instance will be unblocked. -
translate
- Throws:
IOException
-