Class RichContentMessage

  • All Implemented Interfaces:

    
    public class RichContentMessage
    
                        

    图文消息类

    图文消息类,此消息会进行存储并计入未读消息数。

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public String title
      public String content
      public String imgUrl
      public String url
      public final static Creator<RichContentMessage> CREATOR
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getTitle() 获取消息标题。
      void setTitle(String title) 设置消息标题。
      String getContent() 获取消息正文。
      void setContent(String content) 设置消息正文。
      String getImgUrl() 获取消息图片 Imgurl.
      void setImgUrl(String url) 设置消息的图片 Imgurl.
      String getUrl() 获取消息 url.
      void setUrl(String url) 设置消息 url.
      static RichContentMessage obtain(String title, String content, String imageUrl) 生成 RichContentMessage 对象。
      static RichContentMessage obtain(String title, String content, String imageUrl, String url) 生成 RichContentMessage 对象。
      Array<byte> encode() 将本地消息对象序列化为消息数据。
      int describeContents() 描述了包含在 Parcelable 对象排列信息中的特殊对象的类型。
      void writeToParcel(Parcel dest, int flags) 将类的数据写入外部提供的 Parcel 中。
      List<String> getSearchableWord()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RichContentMessage

        RichContentMessage(String title, String content, String imageUrl)
        构造函数。
        Parameters:
        title - 消息标题。
        content - 消息内容。
        imageUrl - 消息图片 url.
      • RichContentMessage

        RichContentMessage(String title, String content, String imageUrl, String url)
        构造函数。
        Parameters:
        title - 消息标题。
        content - 消息内容。
        imageUrl - 消息图片 url.
        url - 消息 url
      • RichContentMessage

        RichContentMessage()
        构造函数。
      • RichContentMessage

        RichContentMessage(Array<byte> data)
        构造函数。
        Parameters:
        data - 存放 json 串的 byte 数组。
    • Method Detail

      • getTitle

         String getTitle()

        获取消息标题。

        Returns:

        消息标题

      • setTitle

         void setTitle(String title)

        设置消息标题。

        Parameters:
        title - 消息标题
      • getContent

         String getContent()

        获取消息正文。

        Returns:

        消息内容

      • setContent

         void setContent(String content)

        设置消息正文。

        Parameters:
        content - 消息内容
      • getImgUrl

         String getImgUrl()

        获取消息图片 Imgurl.

        Returns:

        图片地址

      • setImgUrl

         void setImgUrl(String url)

        设置消息的图片 Imgurl.

        Parameters:
        url - 图片地址
      • getUrl

         String getUrl()

        获取消息 url.

        Returns:

        消息 url

      • setUrl

         void setUrl(String url)

        设置消息 url.

        Parameters:
        url - 消息 url
      • obtain

         static RichContentMessage obtain(String title, String content, String imageUrl)

        生成 RichContentMessage 对象。

        Parameters:
        title - 消息标题。
        content - 消息内容。
        imageUrl - 消息图片 url.
        Returns:

        生成 RichContentMessage 对象。

      • obtain

         static RichContentMessage obtain(String title, String content, String imageUrl, String url)

        生成 RichContentMessage 对象。

        Parameters:
        title - 消息标题。
        content - 消息内容。
        imageUrl - 消息图片 url.
        url - 消息 url
        Returns:

        生成 RichContentMessage 对象。

      • encode

         Array<byte> encode()

        将本地消息对象序列化为消息数据。

        Returns:

        消息数据。

      • describeContents

         int describeContents()

        描述了包含在 Parcelable 对象排列信息中的特殊对象的类型。

        Returns:

        一个标志位,表明 Parcelable 对象特殊对象类型集合的排列。

      • writeToParcel

         void writeToParcel(Parcel dest, int flags)

        将类的数据写入外部提供的 Parcel 中。

        Parameters:
        dest - 对象被写入的 Parcel。
        flags - 对象如何被写入的附加标志,可能是 0 或 PARCELABLE_WRITE_RETURN_VALUE。