Class SaslResponseTypeEncoder
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.encoders.AbstractDescribedTypeEncoder<V>
-
- org.apache.qpid.protonj2.codec.encoders.AbstractDescribedListTypeEncoder<SaslResponse>
-
- org.apache.qpid.protonj2.codec.encoders.security.SaslResponseTypeEncoder
-
- All Implemented Interfaces:
DescribedTypeEncoder<SaslResponse>
,TypeEncoder<SaslResponse>
public final class SaslResponseTypeEncoder extends AbstractDescribedListTypeEncoder<SaslResponse>
Encoder of AMQP SaslResponse type values to a byte stream
-
-
Constructor Summary
Constructors Constructor Description SaslResponseTypeEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnsignedLong
getDescriptorCode()
Symbol
getDescriptorSymbol()
int
getElementCount(SaslResponse challenge)
Gets the number of elements that will result when this type is encoded into an AMQP List type.byte
getListEncoding(SaslResponse value)
Determine the list type the given value can be encoded to based on the number of bytes that would be needed to hold the encoded form of the resulting list entries.int
getMinElementCount()
Return the minimum number of elements that this AMQP type must provide in order to be considered a valid type.Class<SaslResponse>
getTypeClass()
void
writeElement(SaslResponse response, int index, ProtonBuffer buffer, EncoderState state)
Instructs the encoder to write the element identified with the given index-
Methods inherited from class org.apache.qpid.protonj2.codec.encoders.AbstractDescribedListTypeEncoder
writeArray, writeRawArray, writeType
-
Methods inherited from class org.apache.qpid.protonj2.codec.encoders.AbstractDescribedTypeEncoder
isArrayType
-
-
-
-
Method Detail
-
getTypeClass
public Class<SaslResponse> 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.
-
getListEncoding
public byte getListEncoding(SaslResponse value)
Description copied from class:AbstractDescribedListTypeEncoder
Determine the list type the given value can be encoded to based on the number of bytes that would be needed to hold the encoded form of the resulting list entries.Most encoders will return LIST32 but for cases where the type is known to be encoded to LIST8 or always encodes an empty list (LIST0) the encoder can optimize the encode step and not compute sizes.
- Overrides:
getListEncoding
in classAbstractDescribedListTypeEncoder<SaslResponse>
- Parameters:
value
- The value that is to be encoded.- Returns:
- the encoding code of the list type encoding needed for this object.
-
writeElement
public void writeElement(SaslResponse response, int index, ProtonBuffer buffer, EncoderState state)
Description copied from class:AbstractDescribedListTypeEncoder
Instructs the encoder to write the element identified with the given index- Specified by:
writeElement
in classAbstractDescribedListTypeEncoder<SaslResponse>
- Parameters:
response
- the source of the list elements to writeindex
- the element index that needs to be writtenbuffer
- the buffer to write the element tostate
- the current EncoderState value to use.
-
getElementCount
public int getElementCount(SaslResponse challenge)
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 classAbstractDescribedListTypeEncoder<SaslResponse>
- Parameters:
challenge
- the value which will be encoded as a list type.- Returns:
- the number of elements that should comprise the encoded list.
-
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 classAbstractDescribedListTypeEncoder<SaslResponse>
- Returns:
- the minimum number of elements this type must provide.
-
-