-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFriendRequest.java
More file actions
51 lines (50 loc) · 1.05 KB
/
FriendRequest.java
File metadata and controls
51 lines (50 loc) · 1.05 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
import java.util.Date;
public class FriendRequest
{
private User receiver;
private String sender;
// private boolean directionStoE; //The direction of Friend Request.True if user with name s adds user e and false if the opposite happens
private Date timestamp;
private String status;
//Constructor
FriendRequest(User e,String s)
{
// this.directionStoE=true;
this.sender=s;
this.receiver=e;
timestamp= new Date(); //A new object containing the Date and time
status="pending"; //The status of object is initialized as pending
}
//Setter and Getter Methods
String getDateAsString()
{
return timestamp.toString();
}
String getSender()
{
return this.sender;
}
User getReceiver()
{
return this.receiver;
}
/* boolean getDirectionStoE()
{
return this.directionStoE;
}*/
void setStatus(String s)
{
if (s.equals("accepted")||(s.equals("rejected")))
{
this.status=s;
}
else
{
System.err.println("This couldn't happen.");
}
}
String getStatus()
{
return this.status;
}
}