public final class MessageTransportHeaders.Header extends Object
Constructor and Description |
---|
MessageTransportHeaders.Header() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBinaryValue()
Get the byte[] value of this header.
|
int |
getBinaryValueTo(ByteBuffer target)
Get the binary contents of the header value to the provided ByteBuffer.
|
int |
getBinaryValueTo(com.neeve.io.IOBuffer target,
int offset)
Get the binary contents of the header value to the provided IOBuffer.
|
int |
getBinaryValueTo(com.neeve.io.IOElasticBuffer target,
int offset)
Get the binary contents of the header value to the provided IOElasticBuffer.
|
boolean |
getBooleanValue()
Get the boolean value of this header.
|
short |
getByteValue()
Get the byte value of this header.
|
char |
getCharValue()
Get the h value of this header.
|
double |
getDoubleValue()
Get the double value of this header.
|
int |
getEncodedValueLength()
Returns the encoded length of a value.
|
float |
getFloatValue()
Get the float value of this header.
|
int |
getIntValue()
Get the int value of this header.
|
long |
getLongValue()
Returns the header value casting it or converting it to a long if possible.
|
String |
getName()
Gets the name of the header property.
|
XString |
getNameUnsafe()
Gets the name of the header property.
|
short |
getShortValue()
Get the short value of this header.
|
String |
getStringValue()
Gets the String value of the field.
|
void |
getStringValueTo(XString target)
Sets the header value as a string into the provided XString.
|
XString |
getStringValueUnsafe()
Gets the header property value.
|
MessageTransportHeaders.HeaderType |
getType() |
Object |
getValue()
Gets the header property value.
|
public final XString getNameUnsafe()
public final String getName()
This operation is not zero garbage. Use getNameUnsafe()
for
zero garbage access to the header name.
public final MessageTransportHeaders.HeaderType getType()
public final XString getStringValueUnsafe()
Note that as Header instances are reused it is illegal to hold on to the returned value while iterating transport headers.
public final void getStringValueTo(XString target)
Note that as Header instances are reused it is illegal to hold on to the returned value while iterating transport headers.
public String getStringValue()
If the type of the header is not a String the value is converted to a String.
This method is not zero garbage
public long getLongValue()
NumberFormatException
- if the type of the header can't be converted to a long.public int getIntValue()
If the header is not of type MessageTransportHeaders.HeaderType.Int
, the value will be downcast.
NumberFormatException
- if the type of the header can't be converted to a int.public short getShortValue()
If the header is not of type MessageTransportHeaders.HeaderType.Short
, the value will be downcast.
NumberFormatException
- if the type of the header can't be converted to a short.public short getByteValue()
If the header is not of type MessageTransportHeaders.HeaderType.Byte
, the value will be downcast.
NumberFormatException
- if the type of the header can't be converted to a byte.public byte[] getBinaryValue()
If the header is not of type MessageTransportHeaders.HeaderType.Binary
, the value will be downcast.
IllegalArgumentException
- if the header is not of type MessageTransportHeaders.HeaderType.Binary
public int getEncodedValueLength()
public int getBinaryValueTo(com.neeve.io.IOElasticBuffer target, int offset)
target
- The target buffer to copy into.offset
- The offset into the target buffer at which to copy.public int getBinaryValueTo(com.neeve.io.IOBuffer target, int offset)
Callers may call getEncodedValueLength()
to determine the number of
bytes that must be remaining in the target buffer for this call to succeed.
target
- The target buffer to copy into.offset
- The offset into the target buffer at which to copy.public int getBinaryValueTo(ByteBuffer target)
Callers may call getEncodedValueLength()
to determine the number of
bytes that must be remaining in the target buffer for this call to succeed.
Callers may call getEncodedValueLength()
to determine the number of
bytes that must be remaining in the target buffer for the call to succeed.
target
- The target buffer to copy into.IllegalArgumentException
- if the header is not of type MessageTransportHeaders.HeaderType.Binary
public boolean getBooleanValue()
If the header is of type String and the value is "true" or "TRUE" then true is returned, otherwise true is only returned if the header type is Boolean and true.
public char getCharValue()
Note that only ascii characters are currently supported.
public double getDoubleValue()
If the header is not of type MessageTransportHeaders.HeaderType.Double
, the value will be downcast.
NumberFormatException
- if the type of the header can't be converted to a double.public float getFloatValue()
If the header is not of type MessageTransportHeaders.HeaderType.Float
, the value will be downcast.
NumberFormatException
- if the type of the header can't be converted to a float.public final Object getValue()
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.