public class Alert extends BaseOpenmrsObject implements Auditable, Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
TEXT_MAX_LENGTH |
| 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
|
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() |
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()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
equals, getUuid, hashCode, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic static final int TEXT_MAX_LENGTH
public Alert()
public Alert(Integer alertId)
public Alert(String text, Collection<User> users)
text - String to display for the alertusers - Recipients of this alertpublic Integer getAlertId()
public void setAlertId(Integer alertId)
alertId - The alertId to set.public User getCreator()
getCreator in interface Creatablepublic void setCreator(User creator)
setCreator in interface Creatablecreator - The creator to set.public Date getDateCreated()
getDateCreated in interface Creatablepublic void setDateCreated(Date dateCreated)
setDateCreated in interface CreatabledateCreated - 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 Changeablepublic void setChangedBy(User changedBy)
setChangedBy in interface ChangeablechangedBy - The user that changed this alertpublic Date getDateChanged()
getDateChanged in interface Changeablepublic void setDateChanged(Date dateChanged)
setDateChanged in interface ChangeabledateChanged - 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()
BaseOpenmrsObjectClassName{hashCode=..., uuid=...}
If the uuid field is null, it returns:
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString in class BaseOpenmrsObjectObject.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 © 2024 OpenMRS Inc.. All rights reserved.