Package javax.websocket
Interface Decoder.Text<T>
- Type Parameters:
T- The type of the object that is decoded
- All Superinterfaces:
Decoder
- Enclosing interface:
- Decoder
public static interface Decoder.Text<T> extends Decoder
This interface defines how a custom object is decoded from a web socket message in the form of a string.
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.websocket.Decoder
Decoder.Binary<T>, Decoder.BinaryStream<T>, Decoder.Text<T>, Decoder.TextStream<T> -
Method Summary
Modifier and Type Method Description Tdecode(java.lang.String s)Decode the given String into an object of type T.booleanwillDecode(java.lang.String s)Answer whether the given String can be decoded into an object of type T.
-
Method Details
-
decode
Decode the given String into an object of type T.- Parameters:
s- string to be decoded.- Returns:
- the decoded message as an object of type T
- Throws:
DecodeException- If the provided string cannot be decoded to type T
-
willDecode
boolean willDecode(java.lang.String s)Answer whether the given String can be decoded into an object of type T.- Parameters:
s- the string being tested for decodability.- Returns:
- whether this decoder can decoded the supplied string.
-