forked from raghaddmahgoub/OOP-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostnotification.java
More file actions
47 lines (44 loc) · 1.65 KB
/
Postnotification.java
File metadata and controls
47 lines (44 loc) · 1.65 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
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Scanner;
public class Postnotification extends Notification{
Post post;
User friend;
Scanner in = new Scanner(System.in);
public Postnotification(Post post,User friend) {
this.post = post;
this.friend=friend;
TimeStamp= Timestamp.valueOf(LocalDateTime.now());
}
public void tagging(){
System.out.println(getTimeStamp());
System.out.println(friend.getUserName()+" tagged u in a post");
System.out.println("open notification ? y or n");
if (in.next().equals('y')||in.next().equals('Y'))
friend.getPost(post.getId()).Expandpost(friend,post);
}
public void commenting(){
System.out.println(getTimeStamp());
System.out.println(friend.getUserName()+" commented on your post");
System.out.println("open notification ? y or n");
if (in.next().equals('y')||in.next().equals('Y')) {
post.Expandpost(friend,post);
}
}
public void replying(){
System.out.println(getTimeStamp());
System.out.println(friend.getUserName()+" replied on your comment");
System.out.println("open notification ? y or n");
if (in.next().equals('y')||in.next().equals('Y')) {
post.Expandpost(friend,post);
}
}
public void liking(){
System.out.println(getTimeStamp());
System.out.println(friend.getUserName()+" liked on sth u did");
System.out.println("open notification ? y or n");
if (in.next().equals('y')||in.next().equals('Y')) {
post.Expandpost(friend,post);
}
}
}