-
Notifications
You must be signed in to change notification settings - Fork 0
/
Message.py
32 lines (23 loc) · 989 Bytes
/
Message.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import copy
class Message:
def __init__(self, type, timestamp, src, destination, payload):
self._type = copy.deepcopy(type)
self._timestamp = copy.deepcopy(timestamp)
self._source = copy.deepcopy(src)
self._destination = copy.deepcopy(destination)
self._payload = copy.deepcopy(payload)
def get_type(self):
return self._type
def get_destination(self):
return self._destination
def get_source(self):
return self._source
def get_timestamp(self):
return self._timestamp
def get_payload(self):
return self._payload
def __str__(self):
return "Type: %s, Timestamp: %s, Source: %d, Destination: %d"%(self._type,
str(self._timestamp),
self._source,
self._destination)