Top Description Fields Constructors Methods
org.glassfish.tyrus.core.coder

public Class CoderWrapper<T>

extends CoderAdapter
implements Decoder, Encoder
Class Inheritance
All Implemented Interfaces
jakarta.websocket.Encoder, jakarta.websocket.Decoder
Imports
jakarta.websocket.Decoder, .Encoder

Wrapper of coders storing the coder coder class (and optionally coder instance), return type of the encode / decode method and coder class.
Authors
Stepan Kopriva, Pavel Bucek

Field Summary

Modifier and TypeField and Description
private final T
private final Class<? extends T>
private final Class<?>
type

Return type of the encode / decode method.

Constructor Summary

AccessConstructor and Description
public
CoderWrapper(Class<? extends T>
coder class.
coderClass
,
Class<?>
return type provided by the encode / decode method. Cannot be null.
type
)

Construct new coder wrapper.

public
CoderWrapper(T
cannot be null.
coder
,
Class<?>
return type provided by the encode / decode method. Cannot be null.
type
)

Construct new coder wrapper.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

coder instance. null if registered using coder class.
getCoder
()

Get coder instance.

public Class<? extends T>

Returns:

coder class.
getCoderClass
()

Get coder class.

public Class<?>

Returns:

return type of the encode / decode method.
getType
()

Get the return type of the encode / decode method.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.glassfish.tyrus.core.coder.CoderAdapter:
destroyinit

Field Detail

coderback to summary
private final T coder
coderClassback to summary
private final Class<? extends T> coderClass
typeback to summary
private final Class<?> type

Return type of the encode / decode method.

Constructor Detail

CoderWrapperback to summary
public CoderWrapper(Class<? extends T> coderClass, Class<?> type)

Construct new coder wrapper.

Parameters
coderClass:Class<? extends T>

coder class.

type:Class<?>

return type provided by the encode / decode method. Cannot be null.

CoderWrapperback to summary
public CoderWrapper(T coder, Class<?> type)

Construct new coder wrapper.

Parameters
coder:T

cannot be null.

type:Class<?>

return type provided by the encode / decode method. Cannot be null.

Method Detail

getCoderback to summary
public T getCoder()

Get coder instance.

Returns:T

coder instance. null if registered using coder class.

getCoderClassback to summary
public Class<? extends T> getCoderClass()

Get coder class.

Returns:Class<? extends T>

coder class.

getTypeback to summary
public Class<?> getType()

Get the return type of the encode / decode method.

Returns:Class<?>

return type of the encode / decode method.

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.

Returns:String

a string representation of the object

Annotations
@Override