ConversationItem.Builder

class ConversationItem.Builder


A builder for ConversationItem

Summary

Public constructors

Returns an empty Builder instance.

Returns a builder from the given ConversationItem.

Public functions

ConversationItem.Builder
addAction(action: Action)

Adds an additional action for the conversation.

ConversationItem

Returns a new ConversationItem instance defined by this builder

ConversationItem.Builder

Sets a ConversationCallback for the conversation

ConversationItem.Builder
setGroupConversation(isGroupConversation: Boolean)

Specifies whether this conversation involves 3+ participants (a "group" conversation)

ConversationItem.Builder

Sets a CarIcon for the conversation

ConversationItem.Builder

Specifies a unique identifier for the conversation

ConversationItem.Builder

Specifies a list of messages for the conversation

ConversationItem.Builder
setSelf(self: Person)

Sets a Person for the conversation

ConversationItem.Builder
setTitle(title: CarText)

Sets the title of the conversation

Public constructors

Builder

Added in 1.3.0
Builder()

Returns an empty Builder instance.

Builder

Added in 1.4.0-rc02
Builder(other: ConversationItem)

Returns a builder from the given ConversationItem.

Public functions

addAction

Added in 1.4.0-rc02
fun addAction(action: Action): ConversationItem.Builder

Adds an additional action for the conversation.

Throws
java.lang.NullPointerException

if action is null

java.lang.IllegalArgumentException

if action contains unsupported Action types, exceeds the maximum number of allowed actions (1) or does not contain a valid CarIcon.

build

Added in 1.3.0
fun build(): ConversationItem

Returns a new ConversationItem instance defined by this builder

setConversationCallback

Added in 1.4.0-rc02
fun setConversationCallback(conversationCallback: ConversationCallback): ConversationItem.Builder

Sets a ConversationCallback for the conversation

setGroupConversation

Added in 1.3.0
fun setGroupConversation(isGroupConversation: Boolean): ConversationItem.Builder

Specifies whether this conversation involves 3+ participants (a "group" conversation)

If unspecified, conversations are assumed to have exactly two participants (a "1:1" conversation)

UX presentation may differ slightly between group and 1:1 conversations. As a historical example, message readout may include sender names for group conversations, but omit them for 1:1 conversations.

setIcon

Added in 1.3.0
fun setIcon(icon: CarIcon): ConversationItem.Builder

Sets a CarIcon for the conversation

setId

Added in 1.3.0
fun setId(id: String): ConversationItem.Builder

Specifies a unique identifier for the conversation

IDs may be used for a variety of purposes, including...

setMessages

Added in 1.3.0
fun setMessages(messages: (Mutable)List<CarMessage!>): ConversationItem.Builder

Specifies a list of messages for the conversation

The messages should be sorted from oldest to newest.

setSelf

Added in 1.4.0-rc02
fun setSelf(self: Person): ConversationItem.Builder

Sets a Person for the conversation

The Person must specify a non-null setName and setKey.

setTitle

Added in 1.3.0
fun setTitle(title: CarText): ConversationItem.Builder

Sets the title of the conversation