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, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public 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 Creatable
public void setCreator(User creator)
setCreator
in interface Creatable
creator
- The creator to set.public Date getDateCreated()
getDateCreated
in interface Creatable
public void setDateCreated(Date dateCreated)
setDateCreated
in interface Creatable
dateCreated
- 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 Changeable
public void setChangedBy(User changedBy)
setChangedBy
in interface Changeable
changedBy
- The user that changed this alertpublic Date getDateChanged()
getDateChanged
in interface Changeable
public void setDateChanged(Date dateChanged)
setDateChanged
in interface Changeable
dateChanged
- 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)
recipient
recipient
- public Alert markAlertRead()
AlertService.saveAlert(Alert)
public String toString()
BaseOpenmrsObject
ClassName{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 BaseOpenmrsObject
Object.toString()
public Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
Copyright © 2024 OpenMRS Inc.. All rights reserved.