Class Annotation.Builder (0.3.0)

public static final class Annotation.Builder extends GeneratedMessageV3.Builder<Annotation.Builder> implements AnnotationOrBuilder

Output only. Annotations associated with the plain-text body of the message. To add basic formatting to a text message, see Format text messages.

Example plain-text message body: ` Hello @FooBot how are you!"

The corresponding annotations metadata: "annotations":[{ "type":"USER_MENTION", "startIndex":6, "length":7, "userMention": { "user": { "name":"users/{user}", "displayName":"FooBot", "avatarUrl":"https://goo.gl/aeDtrS", "type":"BOT" }, "type":"MENTION" } }] `

Protobuf type google.chat.v1.Annotation

Implements

AnnotationOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Annotation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Annotation.Builder
Overrides

build()

public Annotation build()
Returns
TypeDescription
Annotation

buildPartial()

public Annotation buildPartial()
Returns
TypeDescription
Annotation

clear()

public Annotation.Builder clear()
Returns
TypeDescription
Annotation.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Annotation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Annotation.Builder
Overrides

clearLength()

public Annotation.Builder clearLength()

Length of the substring in the plain-text message body this annotation corresponds to.

int32 length = 3;

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

clearMetadata()

public Annotation.Builder clearMetadata()
Returns
TypeDescription
Annotation.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Annotation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Annotation.Builder
Overrides

clearRichLinkMetadata()

public Annotation.Builder clearRichLinkMetadata()

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Returns
TypeDescription
Annotation.Builder

clearSlashCommand()

public Annotation.Builder clearSlashCommand()

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Returns
TypeDescription
Annotation.Builder

clearStartIndex()

public Annotation.Builder clearStartIndex()

Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

optional int32 start_index = 2;

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

clearType()

public Annotation.Builder clearType()

The type of this annotation.

.google.chat.v1.AnnotationType type = 1;

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

clearUserMention()

public Annotation.Builder clearUserMention()

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Returns
TypeDescription
Annotation.Builder

clone()

public Annotation.Builder clone()
Returns
TypeDescription
Annotation.Builder
Overrides

getDefaultInstanceForType()

public Annotation getDefaultInstanceForType()
Returns
TypeDescription
Annotation

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLength()

public int getLength()

Length of the substring in the plain-text message body this annotation corresponds to.

int32 length = 3;

Returns
TypeDescription
int

The length.

getMetadataCase()

public Annotation.MetadataCase getMetadataCase()
Returns
TypeDescription
Annotation.MetadataCase

getRichLinkMetadata()

public RichLinkMetadata getRichLinkMetadata()

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Returns
TypeDescription
RichLinkMetadata

The richLinkMetadata.

getRichLinkMetadataBuilder()

public RichLinkMetadata.Builder getRichLinkMetadataBuilder()

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Returns
TypeDescription
RichLinkMetadata.Builder

getRichLinkMetadataOrBuilder()

public RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder()

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Returns
TypeDescription
RichLinkMetadataOrBuilder

getSlashCommand()

public SlashCommandMetadata getSlashCommand()

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Returns
TypeDescription
SlashCommandMetadata

The slashCommand.

getSlashCommandBuilder()

public SlashCommandMetadata.Builder getSlashCommandBuilder()

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Returns
TypeDescription
SlashCommandMetadata.Builder

getSlashCommandOrBuilder()

public SlashCommandMetadataOrBuilder getSlashCommandOrBuilder()

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Returns
TypeDescription
SlashCommandMetadataOrBuilder

getStartIndex()

public int getStartIndex()

Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

optional int32 start_index = 2;

Returns
TypeDescription
int

The startIndex.

getType()

public AnnotationType getType()

The type of this annotation.

.google.chat.v1.AnnotationType type = 1;

Returns
TypeDescription
AnnotationType

The type.

getTypeValue()

public int getTypeValue()

The type of this annotation.

.google.chat.v1.AnnotationType type = 1;

Returns
TypeDescription
int

The enum numeric value on the wire for type.

getUserMention()

public UserMentionMetadata getUserMention()

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Returns
TypeDescription
UserMentionMetadata

The userMention.

getUserMentionBuilder()

public UserMentionMetadata.Builder getUserMentionBuilder()

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Returns
TypeDescription
UserMentionMetadata.Builder

getUserMentionOrBuilder()

public UserMentionMetadataOrBuilder getUserMentionOrBuilder()

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Returns
TypeDescription
UserMentionMetadataOrBuilder

hasRichLinkMetadata()

public boolean hasRichLinkMetadata()

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Returns
TypeDescription
boolean

Whether the richLinkMetadata field is set.

hasSlashCommand()

public boolean hasSlashCommand()

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Returns
TypeDescription
boolean

Whether the slashCommand field is set.

hasStartIndex()

public boolean hasStartIndex()

Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

optional int32 start_index = 2;

Returns
TypeDescription
boolean

Whether the startIndex field is set.

hasUserMention()

public boolean hasUserMention()

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Returns
TypeDescription
boolean

Whether the userMention field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Annotation other)

public Annotation.Builder mergeFrom(Annotation other)
Parameter
NameDescription
otherAnnotation
Returns
TypeDescription
Annotation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Annotation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Annotation.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Annotation.Builder
Overrides

mergeRichLinkMetadata(RichLinkMetadata value)

public Annotation.Builder mergeRichLinkMetadata(RichLinkMetadata value)

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Parameter
NameDescription
valueRichLinkMetadata
Returns
TypeDescription
Annotation.Builder

mergeSlashCommand(SlashCommandMetadata value)

public Annotation.Builder mergeSlashCommand(SlashCommandMetadata value)

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Parameter
NameDescription
valueSlashCommandMetadata
Returns
TypeDescription
Annotation.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Annotation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Annotation.Builder
Overrides

mergeUserMention(UserMentionMetadata value)

public Annotation.Builder mergeUserMention(UserMentionMetadata value)

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Parameter
NameDescription
valueUserMentionMetadata
Returns
TypeDescription
Annotation.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Annotation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Annotation.Builder
Overrides

setLength(int value)

public Annotation.Builder setLength(int value)

Length of the substring in the plain-text message body this annotation corresponds to.

int32 length = 3;

Parameter
NameDescription
valueint

The length to set.

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Annotation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Annotation.Builder
Overrides

setRichLinkMetadata(RichLinkMetadata value)

public Annotation.Builder setRichLinkMetadata(RichLinkMetadata value)

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Parameter
NameDescription
valueRichLinkMetadata
Returns
TypeDescription
Annotation.Builder

setRichLinkMetadata(RichLinkMetadata.Builder builderForValue)

public Annotation.Builder setRichLinkMetadata(RichLinkMetadata.Builder builderForValue)

The metadata for a rich link.

.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;

Parameter
NameDescription
builderForValueRichLinkMetadata.Builder
Returns
TypeDescription
Annotation.Builder

setSlashCommand(SlashCommandMetadata value)

public Annotation.Builder setSlashCommand(SlashCommandMetadata value)

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Parameter
NameDescription
valueSlashCommandMetadata
Returns
TypeDescription
Annotation.Builder

setSlashCommand(SlashCommandMetadata.Builder builderForValue)

public Annotation.Builder setSlashCommand(SlashCommandMetadata.Builder builderForValue)

The metadata for a slash command.

.google.chat.v1.SlashCommandMetadata slash_command = 5;

Parameter
NameDescription
builderForValueSlashCommandMetadata.Builder
Returns
TypeDescription
Annotation.Builder

setStartIndex(int value)

public Annotation.Builder setStartIndex(int value)

Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

optional int32 start_index = 2;

Parameter
NameDescription
valueint

The startIndex to set.

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

setType(AnnotationType value)

public Annotation.Builder setType(AnnotationType value)

The type of this annotation.

.google.chat.v1.AnnotationType type = 1;

Parameter
NameDescription
valueAnnotationType

The type to set.

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

setTypeValue(int value)

public Annotation.Builder setTypeValue(int value)

The type of this annotation.

.google.chat.v1.AnnotationType type = 1;

Parameter
NameDescription
valueint

The enum numeric value on the wire for type to set.

Returns
TypeDescription
Annotation.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Annotation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Annotation.Builder
Overrides

setUserMention(UserMentionMetadata value)

public Annotation.Builder setUserMention(UserMentionMetadata value)

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Parameter
NameDescription
valueUserMentionMetadata
Returns
TypeDescription
Annotation.Builder

setUserMention(UserMentionMetadata.Builder builderForValue)

public Annotation.Builder setUserMention(UserMentionMetadata.Builder builderForValue)

The metadata of user mention.

.google.chat.v1.UserMentionMetadata user_mention = 4;

Parameter
NameDescription
builderForValueUserMentionMetadata.Builder
Returns
TypeDescription
Annotation.Builder