Class NoOpTextCoder

java.lang.Object
org.glassfish.tyrus.core.coder.CoderAdapter
org.glassfish.tyrus.core.coder.NoOpTextCoder
All Implemented Interfaces:
Decoder, Decoder.Text<String>, Encoder, Encoder.Text<String>

public class NoOpTextCoder extends CoderAdapter implements Decoder.Text<String>, Encoder.Text<String>
Author:
Stepan Kopriva
  • Constructor Details

    • NoOpTextCoder

      public NoOpTextCoder()
  • Method Details

    • willDecode

      public boolean willDecode(String s)
      Description copied from interface: Decoder.Text
      Answer whether the given String can be decoded into an object of type T.
      Specified by:
      willDecode in interface Decoder.Text<String>
      Parameters:
      s - the string being tested for decodability.
      Returns:
      whether this decoder can decoded the supplied string.
    • decode

      public String decode(String s) throws DecodeException
      Description copied from interface: Decoder.Text
      Decode the given String into an object of type T.
      Specified by:
      decode in interface Decoder.Text<String>
      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
    • encode

      public String encode(String object) throws EncodeException
      Description copied from interface: Encoder.Text
      Encode the given object into a String.
      Specified by:
      encode in interface Encoder.Text<String>
      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