java.lang.Object
org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.AbstractDecoder
org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.BooleanDecoder
All Implemented Interfaces:
jakarta.websocket.Decoder, jakarta.websocket.Decoder.Text<Boolean>

public class BooleanDecoder extends AbstractDecoder implements jakarta.websocket.Decoder.Text<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.

  • Field Details

  • Constructor Details

    • BooleanDecoder

      public BooleanDecoder()
  • Method Details

    • decode

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

      public boolean willDecode(String s)
      Specified by:
      willDecode in interface jakarta.websocket.Decoder.Text<Boolean>