mirror of
http://deavmi.assigned.network/git/deavmi/tristanable
synced 2025-02-20 06:46:50 +00:00
TaggedMessage
- Added documentation for fields `tag` and `data` - Added documentation for both constructors - Added documentation for `getPayload()`, `getTag()`, `setPayload(byte[])` and `setTag(ulong)`
This commit is contained in:
parent
cd0eed6dda
commit
6b04a0325a
@ -10,15 +10,32 @@ module tristanable.encoding;
|
||||
*/
|
||||
public final class TaggedMessage
|
||||
{
|
||||
/**
|
||||
* This message's tag
|
||||
*/
|
||||
private ulong tag;
|
||||
|
||||
/**
|
||||
* The payload
|
||||
*/
|
||||
private byte[] data;
|
||||
|
||||
/**
|
||||
* Constructs a new TaggedMessage with the given tag and payload
|
||||
*
|
||||
* Params:
|
||||
* tag = the tag to use
|
||||
* data = the payload
|
||||
*/
|
||||
this(ulong tag, byte[] data)
|
||||
{
|
||||
this.tag = tag;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameterless constructor used for decoder
|
||||
*/
|
||||
private this() {}
|
||||
|
||||
/**
|
||||
@ -126,21 +143,43 @@ public final class TaggedMessage
|
||||
return encodedMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message's payload
|
||||
*
|
||||
* Returns: the payload
|
||||
*/
|
||||
public byte[] getPayload()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message's tag
|
||||
*
|
||||
* Returns: the tag
|
||||
*/
|
||||
public ulong getTag()
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the message's payload
|
||||
*
|
||||
* Params:
|
||||
* newPayload = the payload to use
|
||||
*/
|
||||
public void setPayload(byte[] newPayload)
|
||||
{
|
||||
this.data = newPayload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the message's tag
|
||||
*
|
||||
* Params:
|
||||
* newTag = the tag to use
|
||||
*/
|
||||
public void setTag(ulong newTag)
|
||||
{
|
||||
this.tag = newTag;
|
||||
|
Loading…
Reference in New Issue
Block a user