Class CoderWrapper<T>

java.lang.Object
org.glassfish.tyrus.core.coder.CoderAdapter
org.glassfish.tyrus.core.coder.CoderWrapper<T>
All Implemented Interfaces:
Decoder, Encoder

public class CoderWrapper<T> extends CoderAdapter implements Decoder, Encoder
Wrapper of coders storing the coder coder class (and optionally coder instance), return type of the encode / decode method and coder class.
Author:
Stepan Kopriva, Pavel Bucek
  • Constructor Details

    • CoderWrapper

      public CoderWrapper(Class<? extends T> coderClass, Class<?> type)
      Construct new coder wrapper.
      Parameters:
      coderClass - coder class.
      type - return type provided by the encode / decode method. Cannot be null.
    • CoderWrapper

      public CoderWrapper(T coder, Class<?> type)
      Construct new coder wrapper.
      Parameters:
      coder - cannot be null.
      type - return type provided by the encode / decode method. Cannot be null.
  • Method Details

    • getType

      public Class<?> getType()
      Get the return type of the encode / decode method.
      Returns:
      return type of the encode / decode method.
    • getCoderClass

      public Class<? extends T> getCoderClass()
      Get coder class.
      Returns:
      coder class.
    • getCoder

      public T getCoder()
      Get coder instance.
      Returns:
      coder instance. null if registered using coder class.
    • toString

      public String toString()
      Overrides:
      toString in class Object