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<Object>
Fall-back encoder - encoders any object to string using
Object.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
-
Method Summary
Methods inherited from class org.glassfish.tyrus.core.coder.CoderAdapter
destroy, init
-
Constructor Details
-
ToStringEncoder
public ToStringEncoder()
-
-
Method Details
-
encode
Description copied from interface:Encoder.Text
Encode the given object into a String.- Specified by:
encode
in interfaceEncoder.Text<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
-