public class Message
extends java.lang.Object
Constructor and Description |
---|
Message(java.lang.String fromNickname,
java.lang.String toNickname,
java.lang.String broadcastNickname,
java.util.Date sentTime,
java.lang.String message,
boolean read)
A constructor to instantiate this class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBroadcastNickname()
A getter for the broadcastNickname
|
java.lang.String |
getFromNickname()
A getter for the fromNickname
|
java.lang.String |
getMessage()
A getter for the message string
|
java.util.Date |
getSentTime()
A getter for the time at which this message was sent
|
java.lang.String |
getToNickname()
A getter for the toNickname
|
boolean |
isRead()
A getter for the read flag which indicates whether the message has been
read
|
void |
setBroadcastNickname(java.lang.String broadcastNickname)
A setter for the broadcastNickname
|
void |
setFromNickname(java.lang.String fromNickname)
A setter for the fromNickname
|
void |
setMessage(java.lang.String message)
A setter for the message string
|
void |
setRead(boolean read)
A setter for the read flag which indicates whether the message has been
read
|
void |
setSentTime(java.util.Date sentTime)
A setter for the time at which this message was sent
|
void |
setToNickname(java.lang.String toNickname)
A setter for the toNickname
|
public Message(java.lang.String fromNickname, java.lang.String toNickname, java.lang.String broadcastNickname, java.util.Date sentTime, java.lang.String message, boolean read) throws WhatsAppRuntimeException
fromNickname
- the nickname of the user sending the messagetoNickname
- the nickname of the user to whom the message is being
sent. This must be null if the message is being broadcast to a broadcast
listbroadcastNickname
- the nickname of the broadcast list to which this
message is being sent. This must be null if the message is being sent to
a single usersentTime
- the instant of time at which the message was sentmessage
- the message string that is being communicated from the
sender to the receiver(s)read
- whether the receiver has read this messageWhatsAppRuntimeException
- read the description of this constructor
for the conditions failing which you may throw this exceptionpublic java.lang.String getFromNickname()
public void setFromNickname(java.lang.String fromNickname)
fromNickname
- the fromNickname of this messagepublic java.lang.String getToNickname()
public void setToNickname(java.lang.String toNickname)
toNickname
- the toNickname of this messagepublic java.lang.String getBroadcastNickname()
public void setBroadcastNickname(java.lang.String broadcastNickname)
broadcastNickname
- the broadcastNickname of this messagepublic java.util.Date getSentTime()
public void setSentTime(java.util.Date sentTime)
sentTime
- the Date object which captures the time at which this
message was sentpublic java.lang.String getMessage()
public void setMessage(java.lang.String message)
message
- the message stringpublic boolean isRead()
public void setRead(boolean read)
read
- the read flag