public final class

CarMessage.Builder

extends java.lang.Object

 java.lang.Object

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

Overview

A builder for CarMessage

Summary

Constructors
publicBuilder()

Methods
public CarMessagebuild()

Returns a new CarMessage instance defined by this builder

public CarMessage.BuildersetBody(CarText body)

Sets a CarText representing the message body

public CarMessage.BuildersetMultimediaMimeType(java.lang.String multimediaMimeType)

Sets a java.lang.String representing the MIME type of a multimedia message

public CarMessage.BuildersetMultimediaUri(Uri multimediaUri)

Sets a pointing to the contents of a multimedia message.

public CarMessage.BuildersetRead(boolean isRead)

Sets a boolean, indicating whether the message has been read

public CarMessage.BuildersetReceivedTimeEpochMillis(long receivedTimeEpochMillis)

Sets a long representing the message timestamp (in epoch millis)

public CarMessage.BuildersetSender(Person sender)

Sets a Person representing the message sender

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

Constructors

public Builder()

Methods

public CarMessage.Builder setSender(Person sender)

Sets a Person representing the message sender

The Person must specify a non-null and .

public CarMessage.Builder setBody(CarText body)

Sets a CarText representing the message body

Messages must have one or both of the following:

  • A message body (text)
  • A MIME type + URI (image, audio, etc.)

See also: CarMessage.Builder.setMultimediaMimeType(String), CarMessage.Builder.setMultimediaUri(Uri)

public CarMessage.Builder setMultimediaMimeType(java.lang.String multimediaMimeType)

Sets a java.lang.String representing the MIME type of a multimedia message

Messages must have one or both of the following:

  • A message body (text)
  • A MIME type + URI (image, audio, etc.)

See also: CarMessage.Builder.setBody(CarText), CarMessage.Builder.setMultimediaUri(Uri)

public CarMessage.Builder setMultimediaUri(Uri multimediaUri)

Sets a pointing to the contents of a multimedia message.

Messages must have one or both of the following:

  • A message body (text)
  • A MIME type + URI (image, audio, etc.)

See also: CarMessage.Builder.setBody(CarText), CarMessage.Builder.setMultimediaMimeType(String)

public CarMessage.Builder setReceivedTimeEpochMillis(long receivedTimeEpochMillis)

Sets a long representing the message timestamp (in epoch millis)

public CarMessage.Builder setRead(boolean isRead)

Sets a boolean, indicating whether the message has been read

public CarMessage build()

Returns a new CarMessage instance defined by this builder