java.lang.Object
org.apache.qpid.protonj2.types.Symbol
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionintbooleanintstatic SymbolgetSASLSymbol(String stringValue) static SymbolgetSASLSymbol(ProtonBuffer symbolBytes) Look up a singletonSymbolinstance that matches the givenProtonBufferbyte view of theSymbolfrom the smaller SASL Symbol cache.static SymbolgetSASLSymbol(ProtonBuffer symbolBuffer, boolean copyOnCreate) Look up a singletonSymbolinstance that matches the givenProtonBufferbyte view of theSymbolfrom the smaller SASL Symbol cache.static Symbolstatic SymbolgetSymbol(ProtonBuffer symbolBytes) static SymbolgetSymbol(ProtonBuffer symbolBuffer, boolean copyOnCreate) inthashCode()toASCII()toString()static SymbolvoidwriteTo(ProtonBuffer target) Writes the internalSymbolbytes to the providedProtonBuffer.
-
Method Details
-
getLength
public int getLength()- Returns:
- the number of bytes that comprise the Symbol value.
-
toASCII
- Returns:
- a read-only view of the
Symbolas a buffer of ASCII bytes.
-
compareTo
- Specified by:
compareToin interfaceComparable<Symbol>
-
toString
-
hashCode
public int hashCode() -
equals
-
writeTo
Writes the internalSymbolbytes to the providedProtonBuffer. 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.
-
valueOf
-
getSymbol
-
getSymbol
- Parameters:
symbolBuffer- TheProtonBufferversion of theSymbolvalue.copyOnCreate- Should the provided buffer be copied during creation of a newSymbol.- Returns:
- a
Symbolthat matches the givenString.
-
getSymbol
-
getSASLSymbol
Look up a singletonSymbolinstance that matches the givenProtonBufferbyte view of theSymbolfrom the smaller SASL Symbol cache. The symbols returned here are meant to only be those used in the SASL exchange during connection establishment.. -
getSASLSymbol
Look up a singletonSymbolinstance that matches the givenProtonBufferbyte view of theSymbolfrom the smaller SASL Symbol cache. The symbols returned here are meant to only be those used in the SASL exchange during connection establishment..- Parameters:
symbolBuffer- TheProtonBufferversion of theSymbolvalue.copyOnCreate- Should the provided buffer be copied during creation of a newSymbol.- Returns:
- a
Symbolthat matches the givenString.
-
getSASLSymbol
-