me.edwards.des.net.packet
Class PacketBallot

java.lang.Object
  extended by me.edwards.des.net.packet.Packet
      extended by me.edwards.des.net.packet.PacketBallot

public class PacketBallot
extends Packet

Ballot Packet

This packet is used to transfer Ballot data between Nodes.

Created on: Nov 3, 2015 at 10:28:29 AM

Author:
Matthew Edwards

Nested Class Summary
 
Nested classes/interfaces inherited from class me.edwards.des.net.packet.Packet
Packet.PacketTypes
 
Field Summary
private  Ballot ballot
           
 
Constructor Summary
PacketBallot(Ballot ballot)
          Creates new PacketBallot
PacketBallot(byte[] binary)
          Creates new PacketBallot from binary data
 
Method Summary
 Ballot getBallot()
          Returns the Ballot transferred by this Packet.
 byte[] getBinary()
          Returns the binary payload of this Packet as a byte array.
 
Methods inherited from class me.edwards.des.net.packet.Packet
getID, lookup, toHex, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ballot

private Ballot ballot
Constructor Detail

PacketBallot

public PacketBallot(Ballot ballot)
Creates new PacketBallot

Parameters:
ballot - Ballot payload

PacketBallot

public PacketBallot(byte[] binary)
Creates new PacketBallot from binary data

Parameters:
binary - Packet binary data as byte array
Method Detail

getBallot

public Ballot getBallot()
Returns the Ballot transferred by this Packet.

Returns:
Ballot payload

getBinary

public byte[] getBinary()
Description copied from class: Packet
Returns the binary payload of this Packet as a byte array.

Specified by:
getBinary in class Packet
Returns:
Binary payload as a byte array