ChatMessageContextData.Builder


public static final class ChatMessageContextData.Builder
extends Object

java.lang.Object
   ↳ android.app.personalcontext.hint.ChatMessageContextData.Builder


Builder for ChatMessageContextData.

Summary

Public constructors

Builder()

Public methods

ChatMessageContextData build()

Builds the ChatMessageContextData.

ChatMessageContextData.Builder setAutofillId(AutofillId autofillId)

Sets the AutofillId of the view that this message corresponds to.

ChatMessageContextData.Builder setRawDateString(String rawDateString)

Sets a user-friendly string representing the date of the message (e.g., "Today").

ChatMessageContextData.Builder setRawTimeString(String rawTimeString)

Sets a user-friendly string representing the time of the message (e.g., "10:00 AM").

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

Added in version 37.2
public ChatMessageContextData build ()

Builds the ChatMessageContextData.

Returns
ChatMessageContextData This value cannot be null.

Throws
NullPointerException if any of setRawTimeString(String), setRawDateString(String), and setAutofillId(AutofillId) are not set.

setAutofillId

Added in version 37.2
public ChatMessageContextData.Builder setAutofillId (AutofillId autofillId)

Sets the AutofillId of the view that this message corresponds to.

This is a required builder input.

Parameters
autofillId AutofillId: This value cannot be null.

Returns
ChatMessageContextData.Builder This value cannot be null.

setRawDateString

Added in version 37.2
public ChatMessageContextData.Builder setRawDateString (String rawDateString)

Sets a user-friendly string representing the date of the message (e.g., "Today").

This is a required builder input and should be a string that is copied directly from the message view and provided as-is.

Parameters
rawDateString String: This value cannot be null.

Returns
ChatMessageContextData.Builder This value cannot be null.

setRawTimeString

Added in version 37.2
public ChatMessageContextData.Builder setRawTimeString (String rawTimeString)

Sets a user-friendly string representing the time of the message (e.g., "10:00 AM").

This is a required builder input and should be a string that is copied directly from the message view and provided as-is.

Parameters
rawTimeString String: This value cannot be null.

Returns
ChatMessageContextData.Builder This value cannot be null.