Class Annotation (0.5.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
TypeDescription
int
public static final int RICH_LINK_METADATA_FIELD_NUMBER
Field Value
TypeDescription
int

SLASH_COMMAND_FIELD_NUMBER

public static final int SLASH_COMMAND_FIELD_NUMBER
Field Value
TypeDescription
int

START_INDEX_FIELD_NUMBER

public static final int START_INDEX_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

USER_MENTION_FIELD_NUMBER

public static final int USER_MENTION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Annotation getDefaultInstance()
Returns
TypeDescription
Annotation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Annotation.Builder newBuilder()
Returns
TypeDescription
Annotation.Builder

newBuilder(Annotation prototype)

public static Annotation.Builder newBuilder(Annotation prototype)
Parameter
NameDescription
prototypeAnnotation
Returns
TypeDescription
Annotation.Builder

parseDelimitedFrom(InputStream input)

public static Annotation parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Annotation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Annotation parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Annotation parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Annotation parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Annotation parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Annotation parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Annotation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Annotation
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Annotation> parser()
Returns
TypeDescription
Parser<Annotation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Annotation getDefaultInstanceForType()
Returns
TypeDescription
Annotation

getLength()

public int getLength()

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

int32 length = 3;

Returns
TypeDescription
int

The length.

getMetadataCase()

public Annotation.MetadataCase getMetadataCase()
Returns
TypeDescription
Annotation.MetadataCase

getParserForType()

public Parser<Annotation> getParserForType()
Returns
TypeDescription
Parser<Annotation>
Overrides

getRichLinkMetadata()

public RichLinkMetadata getRichLinkMetadata()

The metadata for a rich link.

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

Returns
TypeDescription
RichLinkMetadata

The richLinkMetadata.

getRichLinkMetadataOrBuilder()

public RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder()

The metadata for a rich link.

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

Returns
TypeDescription
RichLinkMetadataOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSlashCommand()

public SlashCommandMetadata getSlashCommand()

The metadata for a slash command.

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

Returns
TypeDescription
SlashCommandMetadata

The slashCommand.

getSlashCommandOrBuilder()

public SlashCommandMetadataOrBuilder getSlashCommandOrBuilder()

The metadata for a slash command.

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

Returns
TypeDescription
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
TypeDescription
int

The startIndex.

getType()

public AnnotationType getType()

The type of this annotation.

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

Returns
TypeDescription
AnnotationType

The type.

getTypeValue()

public int getTypeValue()

The type of this annotation.

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

Returns
TypeDescription
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
TypeDescription
UserMentionMetadata

The userMention.

getUserMentionOrBuilder()

public UserMentionMetadataOrBuilder getUserMentionOrBuilder()

The metadata of user mention.

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

Returns
TypeDescription
UserMentionMetadataOrBuilder

hasRichLinkMetadata()

public boolean hasRichLinkMetadata()

The metadata for a rich link.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the startIndex field is set.

hasUserMention()

public boolean hasUserMention()

The metadata of user mention.

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

Returns
TypeDescription
boolean

Whether the userMention field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Annotation.Builder newBuilderForType()
Returns
TypeDescription
Annotation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Annotation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Annotation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Annotation.Builder toBuilder()
Returns
TypeDescription
Annotation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException