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
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > Annotation.BuilderImplements
AnnotationOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Annotation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
build()
public Annotation build()
Returns | |
---|---|
Type | Description |
Annotation |
buildPartial()
public Annotation buildPartial()
Returns | |
---|---|
Type | Description |
Annotation |
clear()
public Annotation.Builder clear()
Returns | |
---|---|
Type | Description |
Annotation.Builder |
clearField(Descriptors.FieldDescriptor field)
public Annotation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
clearLength()
public Annotation.Builder clearLength()
Length of the substring in the plain-text message body this annotation corresponds to.
int32 length = 3;
Returns | |
---|---|
Type | Description |
Annotation.Builder |
This builder for chaining. |
clearMetadata()
public Annotation.Builder clearMetadata()
Returns | |
---|---|
Type | Description |
Annotation.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
public Annotation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
clearRichLinkMetadata()
public Annotation.Builder clearRichLinkMetadata()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Returns | |
---|---|
Type | Description |
Annotation.Builder |
clearSlashCommand()
public Annotation.Builder clearSlashCommand()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
Annotation.Builder |
This builder for chaining. |
clearType()
public Annotation.Builder clearType()
The type of this annotation.
.google.chat.v1.AnnotationType type = 1;
Returns | |
---|---|
Type | Description |
Annotation.Builder |
This builder for chaining. |
clearUserMention()
public Annotation.Builder clearUserMention()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
Returns | |
---|---|
Type | Description |
Annotation.Builder |
clone()
public Annotation.Builder clone()
Returns | |
---|---|
Type | Description |
Annotation.Builder |
getDefaultInstanceForType()
public Annotation getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
Annotation |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
getLength()
public int getLength()
Length of the substring in the plain-text message body this annotation corresponds to.
int32 length = 3;
Returns | |
---|---|
Type | Description |
int |
The length. |
getMetadataCase()
public Annotation.MetadataCase getMetadataCase()
Returns | |
---|---|
Type | Description |
Annotation.MetadataCase |
getRichLinkMetadata()
public RichLinkMetadata getRichLinkMetadata()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Returns | |
---|---|
Type | Description |
RichLinkMetadata |
The richLinkMetadata. |
getRichLinkMetadataBuilder()
public RichLinkMetadata.Builder getRichLinkMetadataBuilder()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Returns | |
---|---|
Type | Description |
RichLinkMetadata.Builder |
getRichLinkMetadataOrBuilder()
public RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Returns | |
---|---|
Type | Description |
RichLinkMetadataOrBuilder |
getSlashCommand()
public SlashCommandMetadata getSlashCommand()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
Returns | |
---|---|
Type | Description |
SlashCommandMetadata |
The slashCommand. |
getSlashCommandBuilder()
public SlashCommandMetadata.Builder getSlashCommandBuilder()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
Returns | |
---|---|
Type | Description |
SlashCommandMetadata.Builder |
getSlashCommandOrBuilder()
public SlashCommandMetadataOrBuilder getSlashCommandOrBuilder()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
int |
The startIndex. |
getType()
public AnnotationType getType()
The type of this annotation.
.google.chat.v1.AnnotationType type = 1;
Returns | |
---|---|
Type | Description |
AnnotationType |
The type. |
getTypeValue()
public int getTypeValue()
The type of this annotation.
.google.chat.v1.AnnotationType type = 1;
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
UserMentionMetadata |
The userMention. |
getUserMentionBuilder()
public UserMentionMetadata.Builder getUserMentionBuilder()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
Returns | |
---|---|
Type | Description |
UserMentionMetadata.Builder |
getUserMentionOrBuilder()
public UserMentionMetadataOrBuilder getUserMentionOrBuilder()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
Returns | |
---|---|
Type | Description |
UserMentionMetadataOrBuilder |
hasRichLinkMetadata()
public boolean hasRichLinkMetadata()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
boolean |
Whether the startIndex field is set. |
hasUserMention()
public boolean hasUserMention()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
Returns | |
---|---|
Type | Description |
boolean |
Whether the userMention field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(Annotation other)
public Annotation.Builder mergeFrom(Annotation other)
Parameter | |
---|---|
Name | Description |
other |
Annotation |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Annotation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public Annotation.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
mergeRichLinkMetadata(RichLinkMetadata value)
public Annotation.Builder mergeRichLinkMetadata(RichLinkMetadata value)
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Parameter | |
---|---|
Name | Description |
value |
RichLinkMetadata |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
SlashCommandMetadata |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Annotation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
mergeUserMention(UserMentionMetadata value)
public Annotation.Builder mergeUserMention(UserMentionMetadata value)
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
Parameter | |
---|---|
Name | Description |
value |
UserMentionMetadata |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public Annotation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
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 | |
---|---|
Name | Description |
value |
int The length to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
setRichLinkMetadata(RichLinkMetadata value)
public Annotation.Builder setRichLinkMetadata(RichLinkMetadata value)
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
Parameter | |
---|---|
Name | Description |
value |
RichLinkMetadata |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
builderForValue |
RichLinkMetadata.Builder |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
SlashCommandMetadata |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
builderForValue |
SlashCommandMetadata.Builder |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
int The startIndex to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
AnnotationType The type to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
int The enum numeric value on the wire for type to set. |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
public final Annotation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
Annotation.Builder |
setUserMention(UserMentionMetadata value)
public Annotation.Builder setUserMention(UserMentionMetadata value)
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
Parameter | |
---|---|
Name | Description |
value |
UserMentionMetadata |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
builderForValue |
UserMentionMetadata.Builder |
Returns | |
---|---|
Type | Description |
Annotation.Builder |