All Implemented Interfaces:
DescribedTypeEncoder<SaslInit>, TypeEncoder<SaslInit>

public final class SaslInitTypeEncoder extends AbstractDescribedListTypeEncoder<SaslInit>
Encoder of AMQP SaslInit type values to a byte stream
  • Field Details

  • Constructor Details

    • SaslInitTypeEncoder

      public SaslInitTypeEncoder()
  • Method Details

    • getTypeClass

      public Class<SaslInit> getTypeClass()
      Returns:
      the Class type that this encoder handles.
    • getDescriptorCode

      public UnsignedLong getDescriptorCode()
      Returns:
      the UnsignedLong value to use as the Descriptor for this type.
    • getDescriptorSymbol

      public Symbol getDescriptorSymbol()
      Returns:
      the Symbol value to use as the Descriptor for this type.
    • getMinElementCount

      public int getMinElementCount()
      Description copied from class: AbstractDescribedListTypeEncoder
      Return the minimum number of elements that this AMQP type must provide in order to be considered a valid type.
      Overrides:
      getMinElementCount in class AbstractDescribedListTypeEncoder<SaslInit>
      Returns:
      the minimum number of elements this type must provide.
    • getMaxElementCount

      public int getMaxElementCount()
      Description copied from class: AbstractDescribedListTypeEncoder
      Returns the maximum number of elements the list body of the described type can carry and is used as a sanity check during encode.
      Specified by:
      getMaxElementCount in class AbstractDescribedListTypeEncoder<SaslInit>
      Returns:
      the maximum number of elements the described type can carry.
    • writeElements

      public void writeElements(SaslInit init, int count, ProtonBuffer buffer, Encoder encoder, EncoderState state)
      Description copied from class: AbstractDescribedListTypeEncoder
      Instructs the encoder to write the elements identified with the given count which should match what it reports as the required number needed for this encoding.
      Specified by:
      writeElements in class AbstractDescribedListTypeEncoder<SaslInit>
      Parameters:
      init - the source of the list elements to write
      count - the number of elements that are to be encoded for this type
      buffer - the buffer to write the element to
      encoder - the current Encoder value to use.
      state - the current EncoderState value to use.
    • getElementCount

      public int getElementCount(SaslInit init)
      Description copied from class: AbstractDescribedListTypeEncoder
      Gets the number of elements that will result when this type is encoded into an AMQP List type.
      Specified by:
      getElementCount in class AbstractDescribedListTypeEncoder<SaslInit>
      Parameters:
      init - the value which will be encoded as a list type.
      Returns:
      the number of elements that should comprise the encoded list.