public class Alert extends BaseOpenmrsObject implements Auditable, Serializable
| Constructor and Description |
|---|
Alert()
Default empty constructor
|
Alert(Integer alertId)
Initializes an alert with the given alert id
|
Alert(String text,
Collection<User> users)
Convenience constructor to create an alert with the given text and for the given users
|
Alert(String text,
User user)
Convenience constructor to create an alert with the given text and for the given users
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRecipient(AlertRecipient r)
Convenience method to add the given AlertRecipient to the list of recipients for this alert
|
void |
addRecipient(User u)
Convenience method to add the given user to this list of recipients for this alert
|
boolean |
equals(Object obj) |
Integer |
getAlertId() |
Boolean |
getAlertRead() |
User |
getChangedBy() |
User |
getCreator() |
Date |
getDateChanged() |
Date |
getDateCreated() |
Date |
getDateToExpire() |
Integer |
getId() |
AlertRecipient |
getRecipient(User recipient)
Convenience method to find the AlertRecipient object within this alert that corresponds to
the given
recipient |
Set<AlertRecipient> |
getRecipients() |
Boolean |
getSatisfiedByAny() |
String |
getText() |
int |
hashCode() |
Boolean |
isAlertRead() |
Boolean |
isSatisfiedByAny() |
Alert |
markAlertRead()
Convenience method to mark this alert as read.
|
void |
removeRecipient(AlertRecipient r)
Convenience method to remove the given AlertRecipient from this Alert's list of recipients
|
void |
setAlertId(Integer alertId) |
void |
setAlertRead(Boolean alertRead) |
void |
setChangedBy(User changedBy) |
void |
setCreator(User creator) |
void |
setDateChanged(Date dateChanged) |
void |
setDateCreated(Date dateCreated) |
void |
setDateToExpire(Date dateToExpire) |
void |
setId(Integer id) |
void |
setRecipients(Set<AlertRecipient> recipients) |
void |
setSatisfiedByAny(Boolean satisfiedByAny) |
void |
setText(String text) |
String |
toString() |
getUuid, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic Alert()
public Alert(Integer alertId)
public Alert(String text, Collection<User> users)
text - String to display for the alertusers - Recipients of this alertpublic boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public Integer getAlertId()
public void setAlertId(Integer alertId)
alertId - The alertId to set.public User getCreator()
getCreator in interface Auditablepublic void setCreator(User creator)
setCreator in interface Auditablecreator - The creator to set.public Date getDateCreated()
getDateCreated in interface Auditablepublic void setDateCreated(Date dateCreated)
setDateCreated in interface AuditabledateCreated - The dateCreated to set.public Date getDateToExpire()
public void setDateToExpire(Date dateToExpire)
dateToExpire - The date To Expire this alertpublic String getText()
public void setText(String text)
text - The text to set.public Boolean getSatisfiedByAny()
isSatisfiedByAny()public Boolean isSatisfiedByAny()
public void setSatisfiedByAny(Boolean satisfiedByAny)
satisfiedByAny - The satisfiedByAny to set.public Boolean getAlertRead()
isAlertRead()public Boolean isAlertRead()
public void setAlertRead(Boolean alertRead)
alertRead - The alertRead to set.public User getChangedBy()
getChangedBy in interface Auditablepublic void setChangedBy(User changedBy)
setChangedBy in interface AuditablechangedBy - The user that changed this alertpublic Date getDateChanged()
getDateChanged in interface Auditablepublic void setDateChanged(Date dateChanged)
setDateChanged in interface AuditabledateChanged - The date this alert was changedpublic Set<AlertRecipient> getRecipients()
public void setRecipients(Set<AlertRecipient> recipients)
recipients - The recipients of this alertpublic void addRecipient(AlertRecipient r)
r - AlertRecipient to addpublic void addRecipient(User u)
u - User to add to list of recipientspublic void removeRecipient(AlertRecipient r)
r - user to remove from list of recipientspublic AlertRecipient getRecipient(User recipient)
recipientrecipient - public Alert markAlertRead()
AlertService.saveAlert(Alert)public String toString()
toString in class ObjectObject.toString()public Integer getId()
getId in interface OpenmrsObjectOpenmrsObject.getId()public void setId(Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)Copyright © 2018 OpenMRS LLC.. All Rights Reserved.