Class 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 (stepan.kopriva at oracle.com), Pavel Bucek (pavel.bucek at oracle.com)
    • Constructor Detail

      • CoderWrapper

        public CoderWrapper​(java.lang.Class<? extends T> coderClass,
                            java.lang.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,
                            java.lang.Class<?> type)
        Construct new coder wrapper.
        Parameters:
        coder - cannot be null.
        type - return type provided by the encode / decode method. Cannot be null.
    • Method Detail

      • getType

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

        public java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object