Class Annotation (0.19.0)

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

Implements

AnnotationOrBuilder

Static Fields

LENGTH_FIELD_NUMBER

public static final int LENGTH_FIELD_NUMBER
Field Value
Type Description
int
public static final int RICH_LINK_METADATA_FIELD_NUMBER
Field Value
Type Description
int

SLASH_COMMAND_FIELD_NUMBER

public static final int SLASH_COMMAND_FIELD_NUMBER
Field Value
Type Description
int

START_INDEX_FIELD_NUMBER

public static final int START_INDEX_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

USER_MENTION_FIELD_NUMBER

public static final int USER_MENTION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Annotation getDefaultInstance()
Returns
Type Description
Annotation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Annotation.Builder newBuilder()
Returns
Type Description
Annotation.Builder

newBuilder(Annotation prototype)

public static Annotation.Builder newBuilder(Annotation prototype)
Parameter
Name Description
prototype Annotation
Returns
Type Description
Annotation.Builder

parseDelimitedFrom(InputStream input)

public static Annotation parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Annotation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Annotation parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Annotation parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Annotation parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Annotation parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Annotation parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Annotation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Annotation> parser()
Returns
Type Description
Parser<Annotation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Annotation getDefaultInstanceForType()
Returns
Type Description
Annotation

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

getParserForType()

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

getRichLinkMetadata()

public RichLinkMetadata getRichLinkMetadata()

The metadata for a rich link.

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

Returns
Type Description
RichLinkMetadata

The richLinkMetadata.

getRichLinkMetadataOrBuilder()

public RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder()

The metadata for a rich link.

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

Returns
Type Description
RichLinkMetadataOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSlashCommand()

public SlashCommandMetadata getSlashCommand()

The metadata for a slash command.

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

Returns
Type Description
SlashCommandMetadata

The slashCommand.

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Annotation.Builder newBuilderForType()
Returns
Type Description
Annotation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Annotation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Annotation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Annotation.Builder toBuilder()
Returns
Type Description
Annotation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException