CarMessage.Builder


public final class CarMessage.Builder


A builder for CarMessage

Summary

Public constructors

Public methods

@NonNull CarMessage

Returns a new CarMessage instance defined by this builder

@NonNull CarMessage.Builder

Sets a CarText representing the message body

@NonNull CarMessage.Builder
setMultimediaMimeType(@Nullable String multimediaMimeType)

Sets a String representing the MIME type of a multimedia message

@NonNull CarMessage.Builder
setMultimediaUri(@Nullable Uri multimediaUri)

Sets a Uri pointing to the contents of a multimedia message.

@NonNull CarMessage.Builder
setRead(boolean isRead)

Sets a boolean, indicating whether the message has been read

@NonNull CarMessage.Builder
setReceivedTimeEpochMillis(long receivedTimeEpochMillis)

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

@NonNull CarMessage.Builder

Sets a Person representing the message sender

Public constructors

Builder

Added in 1.3.0
public Builder()

Public methods

build

Added in 1.3.0
public @NonNull CarMessage build()

Returns a new CarMessage instance defined by this builder

setBody

Added in 1.3.0
public @NonNull CarMessage.Builder setBody(@Nullable 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.)

setMultimediaMimeType

Added in 1.4.0
public @NonNull CarMessage.Builder setMultimediaMimeType(@Nullable String multimediaMimeType)

Sets a 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.)

setMultimediaUri

Added in 1.4.0
public @NonNull CarMessage.Builder setMultimediaUri(@Nullable Uri multimediaUri)

Sets a Uri 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.)

setRead

Added in 1.3.0
public @NonNull CarMessage.Builder setRead(boolean isRead)

Sets a boolean, indicating whether the message has been read

setReceivedTimeEpochMillis

Added in 1.3.0
public @NonNull CarMessage.Builder setReceivedTimeEpochMillis(long receivedTimeEpochMillis)

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

setSender

Added in 1.3.0
public @NonNull CarMessage.Builder setSender(@Nullable Person sender)

Sets a Person representing the message sender

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