ConversationActions.Message.Builder


public final class ConversationActions.Message.Builder


Builder class to construct a Message

Summary

Public constructors

Constructs a builder.

Public methods

@NonNull ConversationActions.Message

Builds the Message object.

@NonNull ConversationActions.Message.Builder

Sets a set of extended data to the message.

@NonNull ConversationActions.Message.Builder
setReferenceTime(@Nullable Long referenceTime)

Sets the reference time of this message, for example it could be the compose or send time of this message.

@NonNull ConversationActions.Message.Builder

Sets the text of this message.

Public constructors

Builder

public Builder(@NonNull Person author)

Constructs a builder.

Parameters
@NonNull Person author

the person that composed the message, use PERSON_USER_SELF to represent the local user. If it is not possible to identify the remote user that the local user is conversing with, use PERSON_USER_OTHERS to represent a remote user.

Public methods

build

public @NonNull ConversationActions.Message build()

Builds the Message object.

setExtras

public @NonNull ConversationActions.Message.Builder setExtras(@Nullable Bundle bundle)

Sets a set of extended data to the message.

setReferenceTime

public @NonNull ConversationActions.Message.Builder setReferenceTime(@Nullable Long referenceTime)

Sets the reference time of this message, for example it could be the compose or send time of this message. This should be milliseconds from the epoch of 1970-01-01T00:00:00Z(UTC timezone). If no reference time or null is set, now is used.

setText

public @NonNull ConversationActions.Message.Builder setText(@Nullable CharSequence text)

Sets the text of this message.