Sequenceablepublic static final class NotificationRequest.NotificationConversationalContent.ConversationalMessage extends Object implements Sequenceable
NotificationConversationalContent. Each message contains the message content, timestamp, and
sender; and the message content and sender information will be displayed in the notification bar.SystemCapability.Notification#ANSSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static Sequenceable.Producer<NotificationRequest.NotificationConversationalContent.ConversationalMessage> |
PRODUCER |
Creates a
ConversationalMessage instance from a Parcel. |
| 构造器 | 说明 |
|---|---|
ConversationalMessage(String text,
long timestamp,
MessageUser sender) |
A constructor used to create a
ConversationalMessage instance with the text, timestamp,
and MessageUser initialized. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
long |
getArrivedTime() |
Obtains the time when this message arrived.
|
String |
getMimeType() |
Obtains the MIME type of this message.
|
MessageUser |
getSender() |
Obtains the sender of this message.
|
String |
getText() |
Obtains the text to be displayed as the content of this message.
|
Uri |
getUri() |
Obtains the URI of the message content with the specific MIME type.
|
boolean |
marshalling(Parcel out) |
Marshals this
ConversationalMessage object into a Parcel. |
NotificationRequest.NotificationConversationalContent.ConversationalMessage |
setData(String mimeType,
Uri uri) |
Sets the MIME type and URI of this message.
|
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals this
ConversationalMessage object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic static final Sequenceable.Producer<NotificationRequest.NotificationConversationalContent.ConversationalMessage> PRODUCER
ConversationalMessage instance from a Parcel.public ConversationalMessage(String text, long timestamp, MessageUser sender) throws IllegalArgumentException
ConversationalMessage instance with the text, timestamp,
and MessageUser initialized.text - Indicates the text to be displayed as the message content. This parameter cannot be null.timestamp - Indicates the time when the message arrived.sender - Indicates the MessageUser who sent the message.IllegalArgumentException - Throws this exception if text is null.public String getText()
public long getArrivedTime()
public MessageUser getSender()
public NotificationRequest.NotificationConversationalContent.ConversationalMessage setData(String mimeType, Uri uri)
mimeType - Indicates the MIME type of this message.uri - Indicates the URI that points to the message content whose type is specified by
the given MIME type.Message object.public String getMimeType()
public Uri getUri()
public boolean marshalling(Parcel out)
ConversationalMessage object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal this
ConversationalMessage object from a Parcel to implement inter-process
communication (IPC).
marshalling 在接口中 Sequenceableout - Indicates the Parcel object for marshalling.true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
ConversationalMessage object from a Parcel.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object for unmarshalling.true if the unmarshalling is successful; returns false otherwise.public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())