Package org.glassfish.tyrus.core.coder
Class ToStringEncoder
- java.lang.Object
-
- org.glassfish.tyrus.core.coder.CoderAdapter
-
- org.glassfish.tyrus.core.coder.ToStringEncoder
-
- All Implemented Interfaces:
Encoder
,Encoder.Text<java.lang.Object>
public class ToStringEncoder extends CoderAdapter implements Encoder.Text<java.lang.Object>
Fall-back encoder - encoders any object to string usingObject.toString()
method.- Author:
- Martin Matula
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jakarta.websocket.Encoder
Encoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>
-
-
Constructor Summary
Constructors Constructor Description ToStringEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
encode(java.lang.Object object)
Encode the given object into a String.-
Methods inherited from class org.glassfish.tyrus.core.coder.CoderAdapter
destroy, init
-
-
-
-
Method Detail
-
encode
public java.lang.String encode(java.lang.Object object) throws EncodeException
Description copied from interface:Encoder.Text
Encode the given object into a String.- Specified by:
encode
in interfaceEncoder.Text<java.lang.Object>
- Parameters:
object
- the object being encoded.- Returns:
- the encoded object as a string.
- Throws:
EncodeException
- The provided object could not be encoded as a string
-
-