# Class LocalNotification.MessagingStyle

java.lang.Object
com.codename1.notifications.LocalNotification.MessagingStyle

Enclosing class:
  `LocalNotification`

public static class LocalNotification.MessagingStyle extends Object
Describes a conversation (messaging style) notification. A messaging style notification renders a sequence of chat messages, each attributed to a sender, and is the recommended presentation for chat and messaging apps.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `LocalNotification.MessagingStyle.Message`
  A single message within a messaging style notification.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MessagingStyle(String selfDisplayName)`
  Creates a messaging style.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LocalNotification.MessagingStyle`
  `addMessage(String text, long timestamp, String senderName)`
  Adds a message to the conversation.
  `LocalNotification.MessagingStyle`
  `conversationTitle(String t)`
  Sets the conversation title shown above the messages.
  `String`
  `getConversationTitle()`
  Returns the conversation title.
  `List<LocalNotification.MessagingStyle.Message>`
  `getMessages()`
  Returns the messages in the conversation.
  `String`
  `getSelfDisplayName()`
  Returns the name representing the device user.
  `LocalNotification.MessagingStyle`
  `groupConversation(boolean b)`
  Marks the conversation as a group conversation (more than two participants).
  `boolean`
  `isGroupConversation()`
  Returns true if this is a group conversation.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MessagingStyle

    public MessagingStyle(String selfDisplayName)

    Creates a messaging style.

    ###### Parameters

    - `selfDisplayName`: the name representing the device user

- ## Method Details

  - ### conversationTitle

    public LocalNotification.MessagingStyle conversationTitle(String t)

    Sets the conversation title shown above the messages.

    ###### Parameters

    - `t`: the conversation title

    ###### Returns

    this messaging style for chaining

  - ### groupConversation

    public LocalNotification.MessagingStyle groupConversation(boolean b)

    Marks the conversation as a group conversation (more than two participants).

    ###### Parameters

    - `b`: true if this is a group conversation

    ###### Returns

    this messaging style for chaining

  - ### addMessage

    public LocalNotification.MessagingStyle addMessage(String text, long timestamp, String senderName)

    Adds a message to the conversation.

    ###### Parameters

    - `text`: the message text

    - `timestamp`: the message timestamp in milliseconds since the epoch

    - `senderName`: the display name of the sender, or null for the device user

    ###### Returns

    this messaging style for chaining

  - ### getSelfDisplayName

    public String getSelfDisplayName()

    Returns the name representing the device user.

    ###### Returns

    the self display name

  - ### getConversationTitle

    public String getConversationTitle()

    Returns the conversation title.

    ###### Returns

    the conversation title, or null

  - ### isGroupConversation

    public boolean isGroupConversation()

    Returns true if this is a group conversation.

    ###### Returns

    true if a group conversation

  - ### getMessages

    public List<LocalNotification.MessagingStyle.Message> getMessages()

    Returns the messages in the conversation.

    ###### Returns

    the messages, never null