Class Annotation (0.32.0)

publicfinalclass AnnotationextendsGeneratedMessageV3implementsAnnotationOrBuilder

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

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

CUSTOM_EMOJI_METADATA_FIELD_NUMBER

publicstaticfinalintCUSTOM_EMOJI_METADATA_FIELD_NUMBER
Field Value
Type Description
int

LENGTH_FIELD_NUMBER

publicstaticfinalintLENGTH_FIELD_NUMBER
Field Value
Type Description
int
publicstaticfinalintRICH_LINK_METADATA_FIELD_NUMBER
Field Value
Type Description
int

SLASH_COMMAND_FIELD_NUMBER

publicstaticfinalintSLASH_COMMAND_FIELD_NUMBER
Field Value
Type Description
int

START_INDEX_FIELD_NUMBER

publicstaticfinalintSTART_INDEX_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

publicstaticfinalintTYPE_FIELD_NUMBER
Field Value
Type Description
int

USER_MENTION_FIELD_NUMBER

publicstaticfinalintUSER_MENTION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticAnnotationgetDefaultInstance()
Returns
Type Description
Annotation

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticAnnotation.BuildernewBuilder()
Returns
Type Description
Annotation.Builder

newBuilder(Annotation prototype)

publicstaticAnnotation.BuildernewBuilder(Annotationprototype)
Parameter
Name Description
prototype Annotation
Returns
Type Description
Annotation.Builder

parseDelimitedFrom(InputStream input)

publicstaticAnnotationparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticAnnotationparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticAnnotationparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticAnnotationparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticAnnotationparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticAnnotationparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticAnnotationparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticAnnotationparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticAnnotationparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticAnnotationparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticAnnotationparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticAnnotationparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Annotation>parser()
Returns
Type Description
Parser<Annotation>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCustomEmojiMetadata()

publicCustomEmojiMetadatagetCustomEmojiMetadata()

The metadata for a custom emoji.

.google.chat.v1.CustomEmojiMetadata custom_emoji_metadata = 7;

Returns
Type Description
CustomEmojiMetadata

The customEmojiMetadata.

getCustomEmojiMetadataOrBuilder()

publicCustomEmojiMetadataOrBuildergetCustomEmojiMetadataOrBuilder()

The metadata for a custom emoji.

.google.chat.v1.CustomEmojiMetadata custom_emoji_metadata = 7;

Returns
Type Description
CustomEmojiMetadataOrBuilder

getDefaultInstanceForType()

publicAnnotationgetDefaultInstanceForType()
Returns
Type Description
Annotation

getLength()

publicintgetLength()

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

int32 length = 3;

Returns
Type Description
int

The length.

getMetadataCase()

publicAnnotation.MetadataCasegetMetadataCase()
Returns
Type Description
Annotation.MetadataCase

getParserForType()

publicParser<Annotation>getParserForType()
Returns
Type Description
Parser<Annotation>
Overrides

getRichLinkMetadata()

publicRichLinkMetadatagetRichLinkMetadata()

The metadata for a rich link.

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

Returns
Type Description
RichLinkMetadata

The richLinkMetadata.

getRichLinkMetadataOrBuilder()

publicRichLinkMetadataOrBuildergetRichLinkMetadataOrBuilder()

The metadata for a rich link.

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

Returns
Type Description
RichLinkMetadataOrBuilder

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getSlashCommand()

publicSlashCommandMetadatagetSlashCommand()

The metadata for a slash command.

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

Returns
Type Description
SlashCommandMetadata

The slashCommand.

getSlashCommandOrBuilder()

publicSlashCommandMetadataOrBuildergetSlashCommandOrBuilder()

The metadata for a slash command.

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

Returns
Type Description
SlashCommandMetadataOrBuilder

getStartIndex()

publicintgetStartIndex()

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()

publicAnnotationTypegetType()

The type of this annotation.

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

Returns
Type Description
AnnotationType

The type.

getTypeValue()

publicintgetTypeValue()

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()

publicUserMentionMetadatagetUserMention()

The metadata of user mention.

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

Returns
Type Description
UserMentionMetadata

The userMention.

getUserMentionOrBuilder()

publicUserMentionMetadataOrBuildergetUserMentionOrBuilder()

The metadata of user mention.

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

Returns
Type Description
UserMentionMetadataOrBuilder

hasCustomEmojiMetadata()

publicbooleanhasCustomEmojiMetadata()

The metadata for a custom emoji.

.google.chat.v1.CustomEmojiMetadata custom_emoji_metadata = 7;

Returns
Type Description
boolean

Whether the customEmojiMetadata field is set.

hasRichLinkMetadata()

publicbooleanhasRichLinkMetadata()

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()

publicbooleanhasSlashCommand()

The metadata for a slash command.

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

Returns
Type Description
boolean

Whether the slashCommand field is set.

hasStartIndex()

publicbooleanhasStartIndex()

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()

publicbooleanhasUserMention()

The metadata of user mention.

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

Returns
Type Description
boolean

Whether the userMention field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicAnnotation.BuildernewBuilderForType()
Returns
Type Description
Annotation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedAnnotation.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Annotation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicAnnotation.BuildertoBuilder()
Returns
Type Description
Annotation.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.