Top Description Inners Fields Constructors Methods
org.glassfish.grizzly

public Class TransformationResult<I, O>

extends Object
implements Cacheable
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.Cacheable

Represents the result of message encoding/decoding.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private static final ThreadCache.CachedTypeIndex<TransformationResult<I, O>>
private int
private String
private I
private O
private TransformationResult.Status

Constructor Summary

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

public
TransformationResult(int
id of the error
errorCode
,
String
error description
errorDescription
)

Creates error transformation result with specific code and description.

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

Method Summary

Modifier and TypeMethod and Description
private static <I, O> TransformationResult<I, O>
create(TransformationResult.Status status, O message, I externalRemainder, int errorCode, String errorDescription)

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

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

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

public int
public String
public I
public O
public TransformationResult.Status
public void
public void
reset()

If implementation uses org.glassfish.grizzly.utils.ObjectPool to store and reuse TransformationResult instances - this method will be called before TransformationResult will be offered to pool.

public void
setErrorCode(int errorCode)

public void
setErrorDescription(String errorDescription)

public void
setExternalRemainder(I externalRemainder)

public void
setMessage(O message)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CACHE_IDXback to summary
private static final ThreadCache.CachedTypeIndex<TransformationResult<I, O>> CACHE_IDX
errorCodeback to summary
private int errorCode
errorDescriptionback to summary
private String errorDescription
externalRemainderback to summary
private I externalRemainder
messageback to summary
private O message
statusback to summary
private TransformationResult.Status status

Constructor Detail

TransformationResultback to summary
public TransformationResult()
TransformationResultback to summary
public TransformationResult(TransformationResult.Status status, O message, I externalRemainder)
TransformationResultback to summary
public TransformationResult(int errorCode, String errorDescription)

Creates error transformation result with specific code and description.

Parameters
errorCode:int

id of the error

errorDescription:String

error description

TransformationResultback to summary
protected TransformationResult(TransformationResult.Status status, O message, I externalRemainder, int errorCode, String errorDescription)

Method Detail

createback to summary
private static <I, O> TransformationResult<I, O> create(TransformationResult.Status status, O message, I externalRemainder, int errorCode, String errorDescription)
Annotations
@SuppressWarnings:unchecked
createCompletedResultback to summary
public static <I, O> TransformationResult<I, O> createCompletedResult(O message, I externalRemainder)
createErrorResultback to summary
public static <I, O> TransformationResult<I, O> createErrorResult(int errorCode, String errorDescription)
createIncompletedResultback to summary
public static <I, O> TransformationResult<I, O> createIncompletedResult(I externalRemainder)
getErrorCodeback to summary
public int getErrorCode()
getErrorDescriptionback to summary
public String getErrorDescription()
getExternalRemainderback to summary
public I getExternalRemainder()
getMessageback to summary
public O getMessage()
getStatusback to summary
public TransformationResult.Status getStatus()
recycleback to summary
public void recycle()

Implements org.glassfish.grizzly.Cacheable.recycle.

Recycle this Context

Annotations
@Override
resetback to summary
public void reset()

If implementation uses org.glassfish.grizzly.utils.ObjectPool to store and reuse TransformationResult instances - this method will be called before TransformationResult will be offered to pool.

setErrorCodeback to summary
public void setErrorCode(int errorCode)
setErrorDescriptionback to summary
public void setErrorDescription(String errorDescription)
setExternalRemainderback to summary
public void setExternalRemainder(I externalRemainder)
setMessageback to summary
public void setMessage(O message)
setStatusback to summary
public void setStatus(TransformationResult.Status status)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.glassfish.grizzly back to summary

public final Enum TransformationResult.Status

extends Enum<TransformationResult.Status>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final TransformationResult.Status
public static final TransformationResult.Status
public static final TransformationResult.Status

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TransformationResult.Status
public static TransformationResult.Status[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COMPLETEback to summary
public static final TransformationResult.Status COMPLETE
ERRORback to summary
public static final TransformationResult.Status ERROR
INCOMPLETEback to summary
public static final TransformationResult.Status INCOMPLETE

Constructor Detail

Statusback to summary
private Status()

Method Detail

valueOfback to summary
public static TransformationResult.Status valueOf(String name)
valuesback to summary
public static TransformationResult.Status[] values()