-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientMsg.java
More file actions
55 lines (44 loc) · 1.32 KB
/
ClientMsg.java
File metadata and controls
55 lines (44 loc) · 1.32 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* [ClientMsg.java]
* An object storing msg, client to and from of msg. This is so that msg can be stored in a queue as an object to buffer incoming and sending out messages
* @author Edward Yang
* @version 1.0
* @since 2020/12/7
*/
class ClientMsg {
/**User that is sending the msg */
private OnlineUser userFrom;
/**user that is receiving the msg */
private OnlineUser userTo;
/**msg that is being sent */
private String msgSent;
/**
* Constructor of the object
* @param uf The userFrom, which user sent the msg
* @param ut The userTo, which user is receiving the msg
* @param msgSent What msg is being sent
*/
ClientMsg(OnlineUser uf, OnlineUser ut, String msgSent){
this.userFrom = uf;
this.userTo = ut;
this.msgSent = msgSent;
}
/**
* @return Method returns the msg being sent as a String
*/
public String getMsg(){
return this.msgSent;
}
/**
* @return the user that the message is being from as a String
*/
public OnlineUser getUserFrom(){
return this.userFrom;
}
/**
* @return the user that the msg is being sent to as a String
*/
public OnlineUser getUserTo(){
return this.userTo;
}
}