java.lang.Object
org.glassfish.grizzly.TransformationResult<I,O>
- All Implemented Interfaces:
Cacheable
Represents the result of message encoding/decoding.
- Author:
- Alexey Stashok
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionTransformationResult(int errorCode, String errorDescription) Creates error transformation result with specific code and description.TransformationResult(TransformationResult.Status status, O message, I externalRemainder) protectedTransformationResult(TransformationResult.Status status, O message, I externalRemainder, int errorCode, String errorDescription) -
Method Summary
Modifier and TypeMethodDescriptionstatic <I,O> TransformationResult<I, O> createCompletedResult(O message, I externalRemainder) static <I,O> TransformationResult<I, O> createErrorResult(int errorCode, String errorDescription) static <I,O> TransformationResult<I, O> createIncompletedResult(I externalRemainder) intvoidrecycle()Recycle thisContextvoidreset()If implementation usesObjectPoolto store and reuseTransformationResultinstances - this method will be called beforeTransformationResultwill be offered to pool.voidsetErrorCode(int errorCode) voidsetErrorDescription(String errorDescription) voidsetExternalRemainder(I externalRemainder) voidsetMessage(O message) voidsetStatus(TransformationResult.Status status) toString()
-
Constructor Details
-
TransformationResult
public TransformationResult() -
TransformationResult
-
TransformationResult
Creates error transformation result with specific code and description.- Parameters:
errorCode- id of the errorerrorDescription- error description
-
TransformationResult
protected TransformationResult(TransformationResult.Status status, O message, I externalRemainder, int errorCode, String errorDescription)
-
-
Method Details
-
createErrorResult
public static <I,O> TransformationResult<I,O> createErrorResult(int errorCode, String errorDescription) -
createCompletedResult
public static <I,O> TransformationResult<I,O> createCompletedResult(O message, I externalRemainder) -
createIncompletedResult
-
getMessage
-
setMessage
-
getExternalRemainder
-
setExternalRemainder
-
getStatus
-
setStatus
-
getErrorCode
public int getErrorCode() -
setErrorCode
public void setErrorCode(int errorCode) -
getErrorDescription
-
setErrorDescription
-
toString
-
reset
public void reset()If implementation usesObjectPoolto store and reuseTransformationResultinstances - this method will be called beforeTransformationResultwill be offered to pool. -
recycle
public void recycle()Recycle thisContext
-