Class BooleanDecoder

  • All Implemented Interfaces:
    javax.websocket.Decoder, javax.websocket.Decoder.Text<java.lang.Boolean>

    public class BooleanDecoder
    extends AbstractDecoder
    implements javax.websocket.Decoder.Text<java.lang.Boolean>
    Default implementation of the Decoder.Text Message to Boolean decoder.

    Note: delegates to Boolean.parseBoolean(String) and will only support "true" and "false" as boolean values.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface javax.websocket.Decoder

        javax.websocket.Decoder.Binary<T extends java.lang.Object>, javax.websocket.Decoder.BinaryStream<T extends java.lang.Object>, javax.websocket.Decoder.Text<T extends java.lang.Object>, javax.websocket.Decoder.TextStream<T extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      BooleanDecoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Boolean decode​(java.lang.String s)  
      boolean willDecode​(java.lang.String s)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.websocket.Decoder

        destroy, init
    • Constructor Detail

      • BooleanDecoder

        public BooleanDecoder()
    • Method Detail

      • decode

        public java.lang.Boolean decode​(java.lang.String s)
                                 throws javax.websocket.DecodeException
        Specified by:
        decode in interface javax.websocket.Decoder.Text<java.lang.Boolean>
        Throws:
        javax.websocket.DecodeException
      • willDecode

        public boolean willDecode​(java.lang.String s)
        Specified by:
        willDecode in interface javax.websocket.Decoder.Text<java.lang.Boolean>