public class Alert extends BaseOpenmrsObject implements Auditable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
TEXT_MAX_LENGTH |
Constructor and Description |
---|
Alert()
Default empty constructor
|
Alert(java.lang.Integer alertId)
Initializes an alert with the given alert id
|
Alert(java.lang.String text,
java.util.Collection<User> users)
Convenience constructor to create an alert with the given text and for the given users
|
Alert(java.lang.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
|
java.lang.Integer |
getAlertId() |
java.lang.Boolean |
getAlertRead() |
User |
getChangedBy() |
User |
getCreator() |
java.util.Date |
getDateChanged() |
java.util.Date |
getDateCreated() |
java.util.Date |
getDateToExpire() |
java.lang.Integer |
getId() |
AlertRecipient |
getRecipient(User recipient)
Convenience method to find the AlertRecipient object within this alert that corresponds to
the given
recipient |
java.util.Set<AlertRecipient> |
getRecipients() |
java.lang.Boolean |
getSatisfiedByAny() |
java.lang.String |
getText() |
java.lang.Boolean |
isAlertRead() |
java.lang.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(java.lang.Integer alertId) |
void |
setAlertRead(java.lang.Boolean alertRead) |
void |
setChangedBy(User changedBy) |
void |
setCreator(User creator) |
void |
setDateChanged(java.util.Date dateChanged) |
void |
setDateCreated(java.util.Date dateCreated) |
void |
setDateToExpire(java.util.Date dateToExpire) |
void |
setId(java.lang.Integer id) |
void |
setRecipients(java.util.Set<AlertRecipient> recipients) |
void |
setSatisfiedByAny(java.lang.Boolean satisfiedByAny) |
void |
setText(java.lang.String text) |
java.lang.String |
toString()
Returns a string consisting of the name of the class of which the object is an instance and
the
uuid field surrounded by [ and ] . |
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(java.lang.Integer alertId)
public Alert(java.lang.String text, java.util.Collection<User> users)
text
- String to display for the alertusers
- Recipients of this alertpublic Alert(java.lang.String text, User user)
text
- String to display for the alertuser
- Recipient of the alertpublic java.lang.Integer getAlertId()
public void setAlertId(java.lang.Integer alertId)
alertId
- The alertId to set.public User getCreator()
getCreator
in interface Auditable
public void setCreator(User creator)
setCreator
in interface Auditable
creator
- The creator to set.public java.util.Date getDateCreated()
getDateCreated
in interface Auditable
public void setDateCreated(java.util.Date dateCreated)
setDateCreated
in interface Auditable
dateCreated
- The dateCreated to set.public java.util.Date getDateToExpire()
public void setDateToExpire(java.util.Date dateToExpire)
dateToExpire
- The date To Expire this alertpublic java.lang.String getText()
public void setText(java.lang.String text)
text
- The text to set.public java.lang.Boolean getSatisfiedByAny()
isSatisfiedByAny()
public java.lang.Boolean isSatisfiedByAny()
public void setSatisfiedByAny(java.lang.Boolean satisfiedByAny)
satisfiedByAny
- The satisfiedByAny to set.public java.lang.Boolean getAlertRead()
isAlertRead()
public java.lang.Boolean isAlertRead()
public void setAlertRead(java.lang.Boolean alertRead)
alertRead
- The alertRead to set.public User getChangedBy()
getChangedBy
in interface Auditable
public void setChangedBy(User changedBy)
setChangedBy
in interface Auditable
changedBy
- The user that changed this alertpublic java.util.Date getDateChanged()
getDateChanged
in interface Auditable
public void setDateChanged(java.util.Date dateChanged)
setDateChanged
in interface Auditable
dateChanged
- The date this alert was changedpublic java.util.Set<AlertRecipient> getRecipients()
public void setRecipients(java.util.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 java.lang.String toString()
BaseOpenmrsObject
uuid
field surrounded by [
and ]
. In other words,
this method returns a string equal to the value of: getClass().getName() + '[' + uuid + ']'
If the uuid
field is null
, it delegates to
Object.toString()
toString
in class BaseOpenmrsObject
Object.toString()
public java.lang.Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.