Class Annotation (0.7.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

getDescriptor()

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

newBuilder()

  public 
  
 static 
  
 Annotation 
 . 
 Builder 
  
 newBuilder 
 () 
 
Returns
Type
Description

newBuilder(Annotation prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getDefaultInstanceForType()

  public 
  
 Annotation 
  
 getDefaultInstanceForType 
 () 
 
Returns
Type
Description

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

getParserForType()

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

The metadata for a rich link.

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

Returns
Type
Description

The richLinkMetadata.

getRichLinkMetadataOrBuilder()

  public 
  
 RichLinkMetadataOrBuilder 
  
 getRichLinkMetadataOrBuilder 
 () 
 

The metadata for a rich link.

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

Returns
Type
Description

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

The slashCommand.

getSlashCommandOrBuilder()

  public 
  
 SlashCommandMetadataOrBuilder 
  
 getSlashCommandOrBuilder 
 () 
 

The metadata for a slash command.

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

Returns
Type
Description

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

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

The userMention.

getUserMentionOrBuilder()

  public 
  
 UserMentionMetadataOrBuilder 
  
 getUserMentionOrBuilder 
 () 
 

The metadata of user mention.

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

Returns
Type
Description
  public 
  
 boolean 
  
 hasRichLinkMetadata 
 () 
 

The metadata for a rich link.

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

Returns
Type
Description

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

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

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

Whether the userMention field is set.

hashCode()

  public 
  
 int 
  
 hashCode 
 () 
 
Returns
Type
Description
int
Overrides

internalGetFieldAccessorTable()

  protected 
  
 GeneratedMessageV3 
 . 
 FieldAccessorTable 
  
 internalGetFieldAccessorTable 
 () 
 
Returns
Type
Description
Overrides

isInitialized()

  public 
  
 final 
  
 boolean 
  
 isInitialized 
 () 
 
Returns
Type
Description
Overrides

newBuilderForType()

  public 
  
 Annotation 
 . 
 Builder 
  
 newBuilderForType 
 () 
 
Returns
Type
Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

  public 
  
 Annotation 
 . 
 Builder 
  
 toBuilder 
 () 
 
Returns
Type
Description

writeTo(CodedOutputStream output)

  public 
  
 void 
  
 writeTo 
 ( 
 CodedOutputStream 
  
 output 
 ) 
 
Parameter
Name
Description
Overrides
Exceptions
Type
Description
Design a Mobile Site
View Site in Mobile | Classic
Share by: