Sequenceablepublic static final class NotificationRequest.NotificationContent extends Object implements Sequenceable
NotificationRequest#setContent(NotificationRequest.NotificationContent) method.
The content type can be NotificationRequest.NotificationNormalContent,
NotificationRequest.NotificationLongTextContent, or
NotificationRequest.NotificationPictureContent.
You can use a constructor of this class to specify the type to use.NotificationRequestSystemCapability.Notification#ANSSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
NOTIFICATION_CONTENT_BASIC_TEXT |
Indicates basic notifications.
|
static int |
NOTIFICATION_CONTENT_CONVERSATION |
Indicates notifications that include a conversation among multiple users.
|
static int |
NOTIFICATION_CONTENT_LONG_TEXT |
Indicates notifications that include long text.
|
static int |
NOTIFICATION_CONTENT_MEDIA |
Indicates notifications that include media playback sessions.
|
static int |
NOTIFICATION_CONTENT_MULTILINE |
Indicates notifications that include multiple independent lines of text.
|
static int |
NOTIFICATION_CONTENT_PICTURE |
Indicates notifications that include a picture.
|
static Sequenceable.Producer<NotificationRequest.NotificationContent> |
PRODUCER |
Creates a
NotificationContent instance from a Parcel. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getContentType() |
Obtains the type value of the notification content.
|
Object |
getNotificationContent() |
Obtains the object matching the current notification content.
|
boolean |
marshalling(Parcel out) |
Marshals a
NotificationContent object into a Parcel. |
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals a
NotificationContent object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic static final int NOTIFICATION_CONTENT_BASIC_TEXT
NotificationRequest.NotificationNormalContent.public static final int NOTIFICATION_CONTENT_CONVERSATION
NotificationRequest.NotificationConversationalContent.public static final int NOTIFICATION_CONTENT_LONG_TEXT
NotificationRequest.NotificationLongTextContent.public static final int NOTIFICATION_CONTENT_MEDIA
NotificationRequest.NotificationMediaContent.public static final int NOTIFICATION_CONTENT_MULTILINE
NotificationRequest.NotificationMultiLineContent.public static final int NOTIFICATION_CONTENT_PICTURE
NotificationRequest.NotificationPictureContent.public static final Sequenceable.Producer<NotificationRequest.NotificationContent> PRODUCER
NotificationContent instance from a Parcel.public NotificationContent(NotificationRequest.NotificationNormalContent normalContent)
NotificationRequest.NotificationNormalContent instance
(obtained by calling getNotificationContent()) and set the content type to
NOTIFICATION_CONTENT_BASIC_TEXT (obtained by calling getContentType()).normalContent - Indicates the NotificationRequest.NotificationNormalContent object.public NotificationContent(NotificationRequest.NotificationLongTextContent longTextContent)
NotificationRequest.NotificationLongTextContent instance
(obtained by calling getNotificationContent()) and set the content type to
NOTIFICATION_CONTENT_LONG_TEXT (obtained by calling getContentType()).longTextContent - Indicates the NotificationRequest.NotificationLongTextContent object.public NotificationContent(NotificationRequest.NotificationPictureContent pictureContent)
NotificationRequest.NotificationPictureContent instance
(obtained by calling getNotificationContent()) and set the content type to
NOTIFICATION_CONTENT_PICTURE (obtained by calling getContentType()).pictureContent - Indicates the NotificationRequest.NotificationPictureContent object.public NotificationContent(NotificationRequest.NotificationConversationalContent conversationContent)
NotificationRequest.NotificationConversationalContent instance
(obtained by calling getNotificationContent()) and set the content type to
NOTIFICATION_CONTENT_CONVERSATION (obtained by calling getContentType()).conversationContent - Indicates the NotificationRequest.NotificationConversationalContent
object.public NotificationContent(NotificationRequest.NotificationMultiLineContent multiLineContent)
NotificationRequest.NotificationMultiLineContent instance
(obtained by calling getNotificationContent()) and set the content type to
NOTIFICATION_CONTENT_CONVERSATION (obtained by calling getContentType()).multiLineContent - Indicates the NotificationRequest.NotificationMultiLineContent
object.public NotificationContent(NotificationRequest.NotificationMediaContent mediaContent)
NotificationRequest.NotificationMediaContent instance
(obtained by calling getNotificationContent()) and set the content type to
NOTIFICATION_CONTENT_MEDIA (obtained by calling getContentType()).mediaContent - Indicates the NotificationRequest.NotificationMediaContent
object.public int getContentType()
NOTIFICATION_CONTENT_BASIC_TEXT, NOTIFICATION_CONTENT_LONG_TEXT,
NOTIFICATION_CONTENT_PICTURE, NOTIFICATION_CONTENT_CONVERSATION,
NOTIFICATION_CONTENT_MULTILINE or NOTIFICATION_CONTENT_MEDIA.public Object getNotificationContent()
NotificationRequest.NotificationLongTextContent,
NotificationRequest.NotificationNormalContent,
NotificationRequest.NotificationPictureContent,
NotificationRequest.NotificationConversationalContent,
NotificationRequest.NotificationMultiLineContent,
or NotificationRequest.NotificationMediaContent.public boolean marshalling(Parcel out)
NotificationContent object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal a
NotificationContent 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)
NotificationContent 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())