Package org.glassfish.tyrus.core.coder
Class CoderWrapper<T>
- java.lang.Object
-
- org.glassfish.tyrus.core.coder.CoderAdapter
-
- org.glassfish.tyrus.core.coder.CoderWrapper<T>
-
public class CoderWrapper<T> extends CoderAdapter implements Decoder, Encoder
Wrapper of coders storing the coder coder class (and optionally coder instance), return type of the encode / decode method and coder class.- Author:
- Stepan Kopriva (stepan.kopriva at oracle.com), Pavel Bucek (pavel.bucek at oracle.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.websocket.Decoder
Decoder.Binary<T>, Decoder.BinaryStream<T>, Decoder.Text<T>, Decoder.TextStream<T>
-
Nested classes/interfaces inherited from interface javax.websocket.Encoder
Encoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>
-
-
Constructor Summary
Constructors Constructor Description CoderWrapper(java.lang.Class<? extends T> coderClass, java.lang.Class<?> type)
Construct new coder wrapper.CoderWrapper(T coder, java.lang.Class<?> type)
Construct new coder wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getCoder()
Get coder instance.java.lang.Class<? extends T>
getCoderClass()
Get coder class.java.lang.Class<?>
getType()
Get the return type of the encode / decode method.java.lang.String
toString()
-
Methods inherited from class org.glassfish.tyrus.core.coder.CoderAdapter
destroy, init
-
-
-
-
Constructor Detail
-
CoderWrapper
public CoderWrapper(java.lang.Class<? extends T> coderClass, java.lang.Class<?> type)
Construct new coder wrapper.- Parameters:
coderClass
- coder class.type
- return type provided by the encode / decode method. Cannot benull
.
-
CoderWrapper
public CoderWrapper(T coder, java.lang.Class<?> type)
Construct new coder wrapper.- Parameters:
coder
- cannot benull
.type
- return type provided by the encode / decode method. Cannot benull
.
-
-
Method Detail
-
getType
public java.lang.Class<?> getType()
Get the return type of the encode / decode method.- Returns:
- return type of the encode / decode method.
-
getCoderClass
public java.lang.Class<? extends T> getCoderClass()
Get coder class.- Returns:
- coder class.
-
getCoder
public T getCoder()
Get coder instance.- Returns:
- coder instance.
null
if registered using coder class.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-