public final class

ConversationItem.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.messaging.model.ConversationItem.Builder

Overview

A builder for ConversationItem

Summary

Constructors
publicBuilder()

Returns an empty ConversationItem.Builder instance.

publicBuilder(ConversationItem other)

Returns a builder from the given ConversationItem.

Methods
public ConversationItem.BuilderaddAction(Action action)

Adds an additional action for the conversation.

public ConversationItembuild()

Returns a new ConversationItem instance defined by this builder

public ConversationItem.BuildersetConversationCallback(ConversationCallback conversationCallback)

Sets a ConversationCallback for the conversation

public ConversationItem.BuildersetGroupConversation(boolean isGroupConversation)

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

public ConversationItem.BuildersetIcon(CarIcon icon)

Sets a CarIcon for the conversation

public ConversationItem.BuildersetId(java.lang.String id)

Specifies a unique identifier for the conversation

public ConversationItem.BuildersetMessages(java.util.List<CarMessage> messages)

Specifies a list of messages for the conversation

public ConversationItem.BuildersetSelf(Person self)

Sets a Person for the conversation

public ConversationItem.BuildersetTitle(CarText title)

Sets the title of the conversation

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Returns an empty ConversationItem.Builder instance.

public Builder(ConversationItem other)

Returns a builder from the given ConversationItem.

Methods

public ConversationItem.Builder setId(java.lang.String id)

Specifies a unique identifier for the conversation

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

public ConversationItem.Builder setTitle(CarText title)

Sets the title of the conversation

public ConversationItem.Builder setIcon(CarIcon icon)

Sets a CarIcon for the conversation

public ConversationItem.Builder setSelf(Person self)

Sets a Person for the conversation

The Person must specify a non-null and .

public ConversationItem.Builder setGroupConversation(boolean isGroupConversation)

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.

public ConversationItem.Builder setMessages(java.util.List<CarMessage> messages)

Specifies a list of messages for the conversation

The messages should be sorted from oldest to newest.

public ConversationItem.Builder setConversationCallback(ConversationCallback conversationCallback)

Sets a ConversationCallback for the conversation

public ConversationItem.Builder addAction(Action action)

Adds an additional action for the conversation.

public ConversationItem build()

Returns a new ConversationItem instance defined by this builder