CarMessage


@CarProtocol
@RequiresCarApi(value = 7)
public class CarMessage


Represents a single message in a ConversationItem

Summary

Nested types

public final class CarMessage.Builder

A builder for CarMessage

Public methods

boolean
@Nullable CarText

Returns a CarText representing the message body

@Nullable String

Returns a String representing the MIME type of a multimedia message

@Nullable Uri

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

long

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

@Nullable Person

Returns a Person representing the message sender.

int
boolean

Returns a boolean, indicating whether the message has been read

Public methods

equals

public boolean equals(@Nullable Object other)

getBody

Added in 1.3.0
public @Nullable CarText getBody()

Returns 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.)

getMultimediaMimeType

Added in 1.4.0
public @Nullable String getMultimediaMimeType()

Returns 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.)

getMultimediaUri

Added in 1.4.0
public @Nullable Uri getMultimediaUri()

Returns 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.)

getReceivedTimeEpochMillis

Added in 1.3.0
public long getReceivedTimeEpochMillis()

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

getSender

Added in 1.3.0
public @Nullable Person getSender()

Returns a Person representing the message sender.

For self-sent messages, this method will return null or getSelf.

hashCode

public int hashCode()

isRead

Added in 1.3.0
public boolean isRead()

Returns a boolean, indicating whether the message has been read