Class Notification
- java.lang.Object
-
- io.github.ma1uta.matrix.push.model.Notification
-
public class Notification extends Object
Information about the push notification.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Notification.Priority
Notification's priority.
-
Field Summary
Fields Modifier and Type Field Description private EventContent
content
The content field from the event, if present.private Counts
counts
This is a dictionary of the current number of unacknowledged communications for the recipient user.private List<Device>
devices
Required.private String
eventId
The Matrix event ID of the event being notified about.private String
prio
The priority of the notification.private String
roomAlias
An alias to display for the room in which the event occurred.private String
roomId
The ID of the room in which this event occurred.private String
roomName
The name of the room in which the event occurred.private String
sender
The sender of the event as in the corresponding event field.private String
senderDisplayName
The current display name of the sender in the room in which the event occurred.private String
type
The type of the event as in the event's type field.private Boolean
userIsTarget
This is true if the user receiving the notification is the subject of a member event (i.e. the state_key of the member event is equal to the user's Matrix ID).
-
Constructor Summary
Constructors Constructor Description Notification()
-
Method Summary
Modifier and Type Method Description EventContent
getContent()
Counts
getCounts()
List<Device>
getDevices()
String
getEventId()
String
getPrio()
String
getRoomAlias()
String
getRoomId()
String
getRoomName()
String
getSender()
String
getSenderDisplayName()
String
getType()
Boolean
getUserIsTarget()
void
setContent(EventContent content)
void
setCounts(Counts counts)
void
setDevices(List<Device> devices)
void
setEventId(String eventId)
void
setPrio(String prio)
void
setRoomAlias(String roomAlias)
void
setRoomId(String roomId)
void
setRoomName(String roomName)
void
setSender(String sender)
void
setSenderDisplayName(String senderDisplayName)
void
setType(String type)
void
setUserIsTarget(Boolean userIsTarget)
-
-
-
Field Detail
-
eventId
private String eventId
The Matrix event ID of the event being notified about. This is required if the notification is about a particular Matrix event. It may be omitted for notifications that only contain updated badge counts. This ID can and should be used to detect duplicate notification requests.
-
roomId
private String roomId
The ID of the room in which this event occurred. Required if the notification relates to a specific Matrix event.
-
type
private String type
The type of the event as in the event's type field.
-
sender
private String sender
The sender of the event as in the corresponding event field.
-
senderDisplayName
private String senderDisplayName
The current display name of the sender in the room in which the event occurred.
-
roomName
private String roomName
The name of the room in which the event occurred.
-
roomAlias
private String roomAlias
An alias to display for the room in which the event occurred.
-
userIsTarget
private Boolean userIsTarget
This is true if the user receiving the notification is the subject of a member event (i.e. the state_key of the member event is equal to the user's Matrix ID).
-
prio
private String prio
The priority of the notification. If omitted, high is assumed. This may be used by push gateways to deliver less time-sensitive notifications in a way that will preserve battery power on mobile devices. One of: ["high", "low"].
-
content
private EventContent content
The content field from the event, if present. If the event had no content field, this field is omitted.
-
counts
private Counts counts
This is a dictionary of the current number of unacknowledged communications for the recipient user. Counts whose value is zero are omitted.
-
-
Method Detail
-
getEventId
public String getEventId()
-
setEventId
public void setEventId(String eventId)
-
getRoomId
public String getRoomId()
-
setRoomId
public void setRoomId(String roomId)
-
getType
public String getType()
-
setType
public void setType(String type)
-
getSender
public String getSender()
-
setSender
public void setSender(String sender)
-
getSenderDisplayName
public String getSenderDisplayName()
-
setSenderDisplayName
public void setSenderDisplayName(String senderDisplayName)
-
getRoomName
public String getRoomName()
-
setRoomName
public void setRoomName(String roomName)
-
getRoomAlias
public String getRoomAlias()
-
setRoomAlias
public void setRoomAlias(String roomAlias)
-
getUserIsTarget
public Boolean getUserIsTarget()
-
setUserIsTarget
public void setUserIsTarget(Boolean userIsTarget)
-
getPrio
public String getPrio()
-
setPrio
public void setPrio(String prio)
-
getContent
public EventContent getContent()
-
setContent
public void setContent(EventContent content)
-
getCounts
public Counts getCounts()
-
setCounts
public void setCounts(Counts counts)
-
-