Class Symbol

  • All Implemented Interfaces:
    Comparable<Symbol>

    public final class Symbol
    extends Object
    implements Comparable<Symbol>
    Class that represents an AMQP Symbol value. The creation of a Symbol object occurs during a lookup operation which cannot find an already stored version of the string or byte buffer view of the Symbol's ASCII bytes.
    • Method Detail

      • getLength

        public int getLength()
        Returns:
        the number of bytes that comprise the Symbol value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • writeTo

        public void writeTo​(ProtonBuffer target)
        Writes the internal Symbol bytes to the provided ProtonBuffer. This is a raw ASCII encoding of the Symbol without and AMQP type encoding.
        Parameters:
        target - The buffer where the Symbol bytes should be written to.
      • getSymbol

        public static Symbol getSymbol​(ProtonBuffer symbolBuffer,
                                       boolean copyOnCreate)
        Look up a singleton Symbol instance that matches the given ProtonBuffer byte view of the Symbol.
        Parameters:
        symbolBuffer - The ProtonBuffer version of the Symbol value.
        copyOnCreate - Should the provided buffer be copied during creation of a new Symbol.
        Returns:
        a Symbol that matches the given String.