Sequenceablepublic static final class NotificationRequest.NotificationNormalContent extends Object implements Sequenceable
This class is used with NotificationContent and NotificationRequest. Example code:
NotificationRequest request = new NotificationRequest(); NotificationNormalContent normalContent = new NotificationNormalContent(); NotificationContent notificationContent = new NotificationContent(normalContent); request.setContent(notificationContent);
NotificationRequest,
NotificationRequest.NotificationContentSystemCapability.Notification#ANSSequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
NotificationNormalContent() |
Default constructor used to create an empty
NotificationNormalContent instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getAdditionalText() |
Obtains the additional text of a basic notification specified by calling the
setAdditionalText(java.lang.String) method. |
String |
getText() |
Obtains the text of a basic notification specified by calling the
setText(java.lang.String) method. |
String |
getTitle() |
Obtains the title of a basic notification specified by calling the
setTitle(java.lang.String) method. |
boolean |
marshalling(Parcel out) |
Marshals a
NotificationNormalContent object into a Parcel. |
NotificationRequest.NotificationNormalContent |
setAdditionalText(String additionalText) |
Sets the additional text to be included in a basic notification.
|
NotificationRequest.NotificationNormalContent |
setText(String text) |
Sets the text to be included in a basic notification.
|
NotificationRequest.NotificationNormalContent |
setTitle(String title) |
Sets the title of a basic notification.
|
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals a
NotificationNormalContent object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic NotificationNormalContent()
NotificationNormalContent instance.public String getTitle()
setTitle(java.lang.String) method.public NotificationRequest.NotificationNormalContent setTitle(String title)
title - Indicates the title of the notification. You can set it to any character string.NotificationNormalContent object with the specified title.public String getText()
setText(java.lang.String) method.public NotificationRequest.NotificationNormalContent setText(String text)
text - Indicates the text to be included. You can set it to any character string.NotificationNormalContent object with the specified text.public String getAdditionalText()
setAdditionalText(java.lang.String) method.public NotificationRequest.NotificationNormalContent setAdditionalText(String additionalText)
The additional text is mainly a supplement to the notification text. Therefore, the font of the additional text is smaller than the notification text and is displayed in a separate line.
additionalText - Indicates the additional text to be included. You can set it to any character string.NotificationNormalContent object with the specified additionalText.public boolean marshalling(Parcel out)
NotificationNormalContent object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal
a NotificationNormalContent 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)
NotificationNormalContent 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())