task/3382: Improve comments to NotificationEvent

This commit is contained in:
Tom Zhao 2024-11-06 11:45:31 +01:00
parent 63c8da867c
commit 0403726460

@ -85,8 +85,6 @@ public abstract class NotificationEvent extends DomainObject {
this.id = id;
}
public abstract Enum getEvent();
public Notification.Type getType() {
return type;
}
@ -95,9 +93,41 @@ public abstract class NotificationEvent extends DomainObject {
this.type = type;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getAdditionalSource() {
return additionalSource;
}
public void setAdditionalSource(String additionalSource) {
this.additionalSource = additionalSource;
}
public User getCausedBy() {
return causedBy;
}
public void setCausedBy(User user) {
this.causedBy = user;
}
public Collection<Notification> getNotifications() {
return notifications;
}
public void setNotifications(Collection<Notification> notifications) {
this.notifications = notifications;
}
// ----------------------------------------------------------------------------------
// Abstract methods to be implemented by subclasses
// ----------------------------------------------------------------------------------
/**
* The title of the entity this event is about.
*
@ -113,39 +143,15 @@ public abstract class NotificationEvent extends DomainObject {
public abstract DomainObject getEntity();
public abstract Enum getEvent();
public Collection<Notification> getNotifications() {
return notifications;
}
public void setNotifications(Collection<Notification> notifications) {
this.notifications = notifications;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
// ----------------------------------------------------------------------------------
// Other Methods
// ----------------------------------------------------------------------------------
public String getTitle() {
return hasEntity() ? getEntityTitle() : "[Deleted entity]";
}
public User getCausedBy() {
return causedBy;
}
public void setCausedBy(User user) {
this.causedBy = user;
}
/**
* Override this method if the event has an association with a {@link Project}.
*
@ -154,12 +160,4 @@ public abstract class NotificationEvent extends DomainObject {
public Project getProject() {
return null;
}
public String getAdditionalSource() {
return additionalSource;
}
public void setAdditionalSource(String additionalSource) {
this.additionalSource = additionalSource;
}
}