org.glassfish.grizzly
Class TransformationResult<I,O>

java.lang.Object
  extended by org.glassfish.grizzly.TransformationResult<I,O>
All Implemented Interfaces:
Cacheable

public class TransformationResult<I,O>
extends java.lang.Object
implements Cacheable

Represents the result of message encoding/decoding.

Author:
Alexey Stashok

Nested Class Summary
static class TransformationResult.Status
           
 
Constructor Summary
  TransformationResult()
           
  TransformationResult(int errorCode, java.lang.String errorDescription)
          Creates error transformation result with specific code and description.
  TransformationResult(TransformationResult.Status status, O message, I externalRemainder)
           
protected TransformationResult(TransformationResult.Status status, O message, I externalRemainder, int errorCode, java.lang.String errorDescription)
           
 
Method Summary
static
<I,O> TransformationResult<I,O>
createCompletedResult(O message, I externalRemainder)
           
static
<I,O> TransformationResult<I,O>
createErrorResult(int errorCode, java.lang.String errorDescription)
           
static
<I,O> TransformationResult<I,O>
createIncompletedResult(I externalRemainder)
           
 int getErrorCode()
           
 java.lang.String getErrorDescription()
           
 I getExternalRemainder()
           
 O getMessage()
           
 TransformationResult.Status getStatus()
           
 void recycle()
          Recycle this Context
 void reset()
          If implementation uses ObjectPool to store and reuse TransformationResult instances - this method will be called before TransformationResult will be offered to pool.
 void setErrorCode(int errorCode)
           
 void setErrorDescription(java.lang.String errorDescription)
           
 void setExternalRemainder(I externalRemainder)
           
 void setMessage(O message)
           
 void setStatus(TransformationResult.Status status)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformationResult

public TransformationResult()

TransformationResult

public TransformationResult(TransformationResult.Status status,
                            O message,
                            I externalRemainder)

TransformationResult

public TransformationResult(int errorCode,
                            java.lang.String errorDescription)
Creates error transformation result with specific code and description.

Parameters:
errorCode - id of the error
errorDescription - error description

TransformationResult

protected TransformationResult(TransformationResult.Status status,
                               O message,
                               I externalRemainder,
                               int errorCode,
                               java.lang.String errorDescription)
Method Detail

createErrorResult

public static <I,O> TransformationResult<I,O> createErrorResult(int errorCode,
                                                                java.lang.String errorDescription)

createCompletedResult

public static <I,O> TransformationResult<I,O> createCompletedResult(O message,
                                                                    I externalRemainder)

createIncompletedResult

public static <I,O> TransformationResult<I,O> createIncompletedResult(I externalRemainder)

getMessage

public O getMessage()

setMessage

public void setMessage(O message)

getExternalRemainder

public I getExternalRemainder()

setExternalRemainder

public void setExternalRemainder(I externalRemainder)

getStatus

public TransformationResult.Status getStatus()

setStatus

public void setStatus(TransformationResult.Status status)

getErrorCode

public int getErrorCode()

setErrorCode

public void setErrorCode(int errorCode)

getErrorDescription

public java.lang.String getErrorDescription()

setErrorDescription

public void setErrorDescription(java.lang.String errorDescription)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

reset

public void reset()
If implementation uses ObjectPool to store and reuse TransformationResult instances - this method will be called before TransformationResult will be offered to pool.


recycle

public void recycle()
Recycle this Context

Specified by:
recycle in interface Cacheable


Copyright © 2012 Oracle Corporation. All Rights Reserved.