This commit is contained in:
24
src/entities/Notification.java
Normal file
24
src/entities/Notification.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package entities;
|
||||
|
||||
import utils.NotificationState;
|
||||
import utils.SendNotificationStrategy;
|
||||
|
||||
public abstract class Notification {
|
||||
protected String content;
|
||||
protected User user;
|
||||
protected NotificationState state;
|
||||
protected SendNotificationStrategy strategy;
|
||||
|
||||
public Notification(String content, User user, SendNotificationStrategy strategy) {
|
||||
this.content = content;
|
||||
this.user = user;
|
||||
this.state = NotificationState.PENDING;
|
||||
this.strategy = strategy;
|
||||
}
|
||||
|
||||
protected boolean isSendable() {
|
||||
return this.state != NotificationState.SENT && this.state != NotificationState.READ;
|
||||
}
|
||||
|
||||
public abstract void send();
|
||||
}
|
||||
Reference in New Issue
Block a user