public
final
class
Annotation
extends
GeneratedMessageV3
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<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > AnnotationImplements
AnnotationOrBuilderStatic Fields
LENGTH_FIELD_NUMBER
public
static
final
int
LENGTH_FIELD_NUMBER
RICH_LINK_METADATA_FIELD_NUMBER
public
static
final
int
RICH_LINK_METADATA_FIELD_NUMBER
SLASH_COMMAND_FIELD_NUMBER
public
static
final
int
SLASH_COMMAND_FIELD_NUMBER
START_INDEX_FIELD_NUMBER
public
static
final
int
START_INDEX_FIELD_NUMBER
TYPE_FIELD_NUMBER
public
static
final
int
TYPE_FIELD_NUMBER
USER_MENTION_FIELD_NUMBER
public
static
final
int
USER_MENTION_FIELD_NUMBER
Static Methods
getDefaultInstance()
public
static
Annotation
getDefaultInstance
()
getDescriptor()
public
static
final
Descriptors
.
Descriptor
getDescriptor
()
newBuilder()
public
static
Annotation
.
Builder
newBuilder
()
newBuilder(Annotation prototype)
public
static
Annotation
.
Builder
newBuilder
(
Annotation
prototype
)
parseDelimitedFrom(InputStream input)
public
static
Annotation
parseDelimitedFrom
(
InputStream
input
)
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Annotation
parseDelimitedFrom
(
InputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(byte[] data)
public
static
Annotation
parseFrom
(
byte
[]
data
)
data
byte
[]
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public
static
Annotation
parseFrom
(
byte
[]
data
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(ByteString data)
public
static
Annotation
parseFrom
(
ByteString
data
)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public
static
Annotation
parseFrom
(
ByteString
data
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(CodedInputStream input)
public
static
Annotation
parseFrom
(
CodedInputStream
input
)
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Annotation
parseFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(InputStream input)
public
static
Annotation
parseFrom
(
InputStream
input
)
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Annotation
parseFrom
(
InputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(ByteBuffer data)
public
static
Annotation
parseFrom
(
ByteBuffer
data
)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public
static
Annotation
parseFrom
(
ByteBuffer
data
,
ExtensionRegistryLite
extensionRegistry
)
parser()
public
static
Parser<Annotation>
parser
()
Methods
equals(Object obj)
public
boolean
equals
(
Object
obj
)
getDefaultInstanceForType()
public
Annotation
getDefaultInstanceForType
()
getLength()
public
int
getLength
()
Length of the substring in the plain-text message body this annotation corresponds to.
int32 length = 3;
getMetadataCase()
public
Annotation
.
MetadataCase
getMetadataCase
()
getParserForType()
public
Parser<Annotation>
getParserForType
()
getRichLinkMetadata()
public
RichLinkMetadata
getRichLinkMetadata
()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
getRichLinkMetadataOrBuilder()
public
RichLinkMetadataOrBuilder
getRichLinkMetadataOrBuilder
()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
getSerializedSize()
public
int
getSerializedSize
()
getSlashCommand()
public
SlashCommandMetadata
getSlashCommand
()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
getSlashCommandOrBuilder()
public
SlashCommandMetadataOrBuilder
getSlashCommandOrBuilder
()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
getStartIndex()
public
int
getStartIndex
()
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
optional int32 start_index = 2;
getType()
public
AnnotationType
getType
()
The type of this annotation.
.google.chat.v1.AnnotationType type = 1;
getTypeValue()
public
int
getTypeValue
()
The type of this annotation.
.google.chat.v1.AnnotationType type = 1;
getUserMention()
public
UserMentionMetadata
getUserMention
()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
getUserMentionOrBuilder()
public
UserMentionMetadataOrBuilder
getUserMentionOrBuilder
()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
hasRichLinkMetadata()
public
boolean
hasRichLinkMetadata
()
The metadata for a rich link.
.google.chat.v1.RichLinkMetadata rich_link_metadata = 6;
hasSlashCommand()
public
boolean
hasSlashCommand
()
The metadata for a slash command.
.google.chat.v1.SlashCommandMetadata slash_command = 5;
hasStartIndex()
public
boolean
hasStartIndex
()
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
optional int32 start_index = 2;
hasUserMention()
public
boolean
hasUserMention
()
The metadata of user mention.
.google.chat.v1.UserMentionMetadata user_mention = 4;
hashCode()
public
int
hashCode
()
internalGetFieldAccessorTable()
protected
GeneratedMessageV3
.
FieldAccessorTable
internalGetFieldAccessorTable
()
isInitialized()
public
final
boolean
isInitialized
()
newBuilderForType()
public
Annotation
.
Builder
newBuilderForType
()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected
Annotation
.
Builder
newBuilderForType
(
GeneratedMessageV3
.
BuilderParent
parent
)
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected
Object
newInstance
(
GeneratedMessageV3
.
UnusedPrivateParameter
unused
)
toBuilder()
public
Annotation
.
Builder
toBuilder
()
writeTo(CodedOutputStream output)
public
void
writeTo
(
CodedOutputStream
output
)