All Implemented Interfaces:
DescribedTypeDecoder<Accepted>, StreamDescribedTypeDecoder<Accepted>, StreamTypeDecoder<Accepted>, TypeDecoder<Accepted>

public final class AcceptedTypeDecoder extends AbstractDescribedListTypeDecoder<Accepted>
Decoder of AMQP Accepted type values from a byte stream.
  • Field Details

  • Constructor Details

    • AcceptedTypeDecoder

      public AcceptedTypeDecoder()
  • Method Details

    • getTypeClass

      public Class<Accepted> getTypeClass()
      Description copied from interface: TypeDecoder
      Returns the Class that this decoder handles.
      Returns:
      the Class that this decoder handles
    • getDescriptorCode

      public UnsignedLong getDescriptorCode()
      Description copied from interface: DescribedTypeDecoder
      Returns the AMQP descriptor code for the type this decoder reads.
      Returns:
      an unsigned long descriptor code value.
    • getDescriptorSymbol

      public Symbol getDescriptorSymbol()
      Description copied from interface: DescribedTypeDecoder
      Returns the AMQP descriptor symbol for the type this decoder reads.
      Returns:
      an symbol descriptor code value.
    • getMinListElements

      protected int getMinListElements()
      Description copied from class: AbstractDescribedListTypeDecoder
      (@return the minimum number of elements that must appear in this list type}
      Specified by:
      getMinListElements in class AbstractDescribedListTypeDecoder<Accepted>
    • getMaxListElements

      protected int getMaxListElements()
      Description copied from class: AbstractDescribedListTypeDecoder
      Returns the maximum number of elements that may appear in this list type.
      Specified by:
      getMaxListElements in class AbstractDescribedListTypeDecoder<Accepted>
      Returns:
      the maximum number of elements that may appear in this list type
    • readSingle

      protected Accepted readSingle(ProtonBuffer buffer, DecoderState state, ListTypeDecoder listDecoder) throws DecodeException
      Description copied from class: AbstractDescribedListTypeDecoder
      Reads a single instance of the described list type using the provided decoder. The default implementation performs a series of validation checks on the incoming encoded data and then calls the abstract readListType method which can assume the basic contracts of the encoding are correct and simply read the elements into the final described type object.
      Overrides:
      readSingle in class AbstractDescribedListTypeDecoder<Accepted>
      Parameters:
      buffer - The source of the encoded bytes to read the value from.
      state - The decoder state that was passed at the start of decoding.
      listDecoder - The list decoder that indicates the structure of the encoded lists of elements.
      Returns:
      a single value that is the described type this decoder reads using the given list decoder.
      Throws:
      DecodeException - if an error occurs while performing the decode.
    • readSingle

      protected Accepted readSingle(InputStream stream, StreamDecoderState state, ListTypeDecoder listDecoder) throws DecodeException
      Description copied from class: AbstractDescribedListTypeDecoder
      Reads a single instance of the described list type using the provided decoder. The default implementation performs a series of validation checks on the incoming encoded data and then calls the abstract readListType method which can assume the basic contracts of the encoding are correct and simply read the elements into the final described type object.
      Overrides:
      readSingle in class AbstractDescribedListTypeDecoder<Accepted>
      Parameters:
      stream - The source of the encoded bytes to read the value from.
      state - The decoder state that was passed at the start of decoding.
      listDecoder - The list decoder that indicates the structure of the encoded lists of elements.
      Returns:
      a single value that is the described type this decoder reads using the given list decoder.
      Throws:
      DecodeException - if an error occurs while performing the decode.
    • readType

      protected Accepted readType(int count, ProtonBuffer buffer, Decoder decoder, DecoderState state) throws DecodeException
      Description copied from class: AbstractDescribedListTypeDecoder
      Reads the actual type from the byte stream with the given number of encoded list elements populated
      Specified by:
      readType in class AbstractDescribedListTypeDecoder<Accepted>
      Parameters:
      count - The number of entries encoded into the list body.
      buffer - The source of the encoded bytes to read the value from.
      decoder - The list decoder that indicates the structure of the encoded lists of elements.
      state - The decoder state that was passed at the start of decoding.
      Returns:
      a single value that is the described type this decoder reads using the given list decoder.
      Throws:
      DecodeException - if an error occurs while performing the decode.
    • readType

      protected Accepted readType(int count, InputStream stream, StreamDecoder decoder, StreamDecoderState state) throws DecodeException
      Description copied from class: AbstractDescribedListTypeDecoder
      Reads the actual type from the byte stream with the given number of encoded list elements populated
      Specified by:
      readType in class AbstractDescribedListTypeDecoder<Accepted>
      Parameters:
      count - The number of entries encoded into the list body.
      stream - The source of the encoded bytes to read the value from.
      decoder - The list decoder that indicates the structure of the encoded lists of elements.
      state - The decoder state that was passed at the start of decoding.
      Returns:
      a single value that is the described type this decoder reads using the given list decoder.
      Throws:
      DecodeException - if an error occurs while performing the decode.