public abstract class BinaryProtocol.Message extends Object
All non-abstract subclasses must implement a constructor with a ByteBuffer argument. This constructor is used during serialization to recreate the Message instance. It's considered good practice to declare all attributes of a message as final. It's a simple way to ensure that the above constructor has initialized all the attributes of the message.
| Constructor and Description |
|---|
Message() |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
allocateInitializedBuffer(int size)
Allocate a buffer for the message with the header initialized.
|
abstract BinaryProtocol.MessageOp |
getOp() |
boolean |
match(BinaryProtocol.Message other) |
String |
toString() |
ByteBuffer |
wireFormat()
The default message consists of the operation enum and just a 0
length size.
|
public abstract BinaryProtocol.MessageOp getOp()
public ByteBuffer wireFormat()
public boolean match(BinaryProtocol.Message other)
public ByteBuffer allocateInitializedBuffer(int size)
size - size of the message contents following the bufferCopyright © 2024. All rights reserved.