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
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
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()
getDescriptor()
publicstaticfinalDescriptors.DescriptorgetDescriptor()
newBuilder()
publicstaticAnnotation.BuildernewBuilder()
newBuilder(Annotation prototype)
publicstaticAnnotation.BuildernewBuilder(Annotationprototype)
publicstaticAnnotationparseDelimitedFrom(InputStreaminput)
publicstaticAnnotationparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
parseFrom(byte[] data)
publicstaticAnnotationparseFrom(byte[]data)
| Parameter |
| Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
publicstaticAnnotationparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
parseFrom(ByteString data)
publicstaticAnnotationparseFrom(ByteStringdata)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
publicstaticAnnotationparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
publicstaticAnnotationparseFrom(CodedInputStreaminput)
publicstaticAnnotationparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
publicstaticAnnotationparseFrom(InputStreaminput)
publicstaticAnnotationparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
parseFrom(ByteBuffer data)
publicstaticAnnotationparseFrom(ByteBufferdata)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
publicstaticAnnotationparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
parser()
publicstaticParser<Annotation>parser()
Methods
equals(Object obj)
publicbooleanequals(Objectobj)
| Parameter |
| Name |
Description |
obj |
Object
|
Overrides
publicCustomEmojiMetadatagetCustomEmojiMetadata()
The metadata for a custom emoji.
.google.chat.v1.CustomEmojiMetadata custom_emoji_metadata = 7;
publicCustomEmojiMetadataOrBuildergetCustomEmojiMetadataOrBuilder()
The metadata for a custom emoji.
.google.chat.v1.CustomEmojiMetadata custom_emoji_metadata = 7;
getDefaultInstanceForType()
publicAnnotationgetDefaultInstanceForType()
getLength()
Length of the substring in the plain-text message body this annotation
corresponds to.
int32 length = 3;
| Returns |
| Type |
Description |
int |
The length.
|
publicAnnotation.MetadataCasegetMetadataCase()
getParserForType()
publicParser<Annotation>getParserForType()
Overrides
publicRichLinkMetadatagetRichLinkMetadata()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
publicRichLinkMetadataOrBuildergetRichLinkMetadataOrBuilder()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
getSerializedSize()
publicintgetSerializedSize()
| Returns |
| Type |
Description |
int |
Overrides
getSlashCommand()
publicSlashCommandMetadatagetSlashCommand()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
getSlashCommandOrBuilder()
publicSlashCommandMetadataOrBuildergetSlashCommandOrBuilder()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
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()
publicAnnotationTypegetType()
The type of this annotation.
.google.chat.v1.AnnotationType type = 1;
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()
publicUserMentionMetadatagetUserMention()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
getUserMentionOrBuilder()
publicUserMentionMetadataOrBuildergetUserMentionOrBuilder()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
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.
|
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()
| Returns |
| Type |
Description |
int |
Overrides
internalGetFieldAccessorTable()
protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Overrides
isInitialized()
publicfinalbooleanisInitialized()
Overrides
newBuilderForType()
publicAnnotation.BuildernewBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protectedAnnotation.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
| Returns |
| Type |
Description |
Object |
Overrides
toBuilder()
publicAnnotation.BuildertoBuilder()
writeTo(CodedOutputStream output)
publicvoidwriteTo(CodedOutputStreamoutput)
Overrides