Class AnnotateTextResponse.Builder (2.18.0)

publicstaticfinalclass AnnotateTextResponse.BuilderextendsGeneratedMessageV3.Builder<AnnotateTextResponse.Builder>implementsAnnotateTextResponseOrBuilder

The text annotations response message.

Protobuf type google.cloud.language.v1.AnnotateTextResponse

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllCategories(Iterable<? extends ClassificationCategory> values)

publicAnnotateTextResponse.BuilderaddAllCategories(Iterable<?extendsClassificationCategory>values)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
values Iterable<? extends com.google.cloud.language.v1.ClassificationCategory>
Returns
Type Description
AnnotateTextResponse.Builder

addAllEntities(Iterable<? extends Entity> values)

publicAnnotateTextResponse.BuilderaddAllEntities(Iterable<?extendsEntity>values)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
values Iterable<? extends com.google.cloud.language.v1.Entity>
Returns
Type Description
AnnotateTextResponse.Builder

addAllSentences(Iterable<? extends Sentence> values)

publicAnnotateTextResponse.BuilderaddAllSentences(Iterable<?extendsSentence>values)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
values Iterable<? extends com.google.cloud.language.v1.Sentence>
Returns
Type Description
AnnotateTextResponse.Builder

addAllTokens(Iterable<? extends Token> values)

publicAnnotateTextResponse.BuilderaddAllTokens(Iterable<?extendsToken>values)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
values Iterable<? extends com.google.cloud.language.v1.Token>
Returns
Type Description
AnnotateTextResponse.Builder

addCategories(ClassificationCategory value)

publicAnnotateTextResponse.BuilderaddCategories(ClassificationCategoryvalue)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
value ClassificationCategory
Returns
Type Description
AnnotateTextResponse.Builder

addCategories(ClassificationCategory.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddCategories(ClassificationCategory.BuilderbuilderForValue)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
builderForValue ClassificationCategory.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addCategories(int index, ClassificationCategory value)

publicAnnotateTextResponse.BuilderaddCategories(intindex,ClassificationCategoryvalue)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameters
Name Description
index int
value ClassificationCategory
Returns
Type Description
AnnotateTextResponse.Builder

addCategories(int index, ClassificationCategory.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddCategories(intindex,ClassificationCategory.BuilderbuilderForValue)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameters
Name Description
index int
builderForValue ClassificationCategory.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addCategoriesBuilder()

publicClassificationCategory.BuilderaddCategoriesBuilder()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
Type Description
ClassificationCategory.Builder

addCategoriesBuilder(int index)

publicClassificationCategory.BuilderaddCategoriesBuilder(intindex)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
index int
Returns
Type Description
ClassificationCategory.Builder

addEntities(Entity value)

publicAnnotateTextResponse.BuilderaddEntities(Entityvalue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
value Entity
Returns
Type Description
AnnotateTextResponse.Builder

addEntities(Entity.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddEntities(Entity.BuilderbuilderForValue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
builderForValue Entity.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addEntities(int index, Entity value)

publicAnnotateTextResponse.BuilderaddEntities(intindex,Entityvalue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameters
Name Description
index int
value Entity
Returns
Type Description
AnnotateTextResponse.Builder

addEntities(int index, Entity.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddEntities(intindex,Entity.BuilderbuilderForValue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameters
Name Description
index int
builderForValue Entity.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addEntitiesBuilder()

publicEntity.BuilderaddEntitiesBuilder()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Returns
Type Description
Entity.Builder

addEntitiesBuilder(int index)

publicEntity.BuilderaddEntitiesBuilder(intindex)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
index int
Returns
Type Description
Entity.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicAnnotateTextResponse.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

addSentences(Sentence value)

publicAnnotateTextResponse.BuilderaddSentences(Sentencevalue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
value Sentence
Returns
Type Description
AnnotateTextResponse.Builder

addSentences(Sentence.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddSentences(Sentence.BuilderbuilderForValue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
builderForValue Sentence.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addSentences(int index, Sentence value)

publicAnnotateTextResponse.BuilderaddSentences(intindex,Sentencevalue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameters
Name Description
index int
value Sentence
Returns
Type Description
AnnotateTextResponse.Builder

addSentences(int index, Sentence.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddSentences(intindex,Sentence.BuilderbuilderForValue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameters
Name Description
index int
builderForValue Sentence.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addSentencesBuilder()

publicSentence.BuilderaddSentencesBuilder()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Returns
Type Description
Sentence.Builder

addSentencesBuilder(int index)

publicSentence.BuilderaddSentencesBuilder(intindex)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
index int
Returns
Type Description
Sentence.Builder

addTokens(Token value)

publicAnnotateTextResponse.BuilderaddTokens(Tokenvalue)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
value Token
Returns
Type Description
AnnotateTextResponse.Builder

addTokens(Token.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddTokens(Token.BuilderbuilderForValue)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
builderForValue Token.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addTokens(int index, Token value)

publicAnnotateTextResponse.BuilderaddTokens(intindex,Tokenvalue)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameters
Name Description
index int
value Token
Returns
Type Description
AnnotateTextResponse.Builder

addTokens(int index, Token.Builder builderForValue)

publicAnnotateTextResponse.BuilderaddTokens(intindex,Token.BuilderbuilderForValue)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameters
Name Description
index int
builderForValue Token.Builder
Returns
Type Description
AnnotateTextResponse.Builder

addTokensBuilder()

publicToken.BuilderaddTokensBuilder()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
Type Description
Token.Builder

addTokensBuilder(int index)

publicToken.BuilderaddTokensBuilder(intindex)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
index int
Returns
Type Description
Token.Builder

build()

publicAnnotateTextResponsebuild()
Returns
Type Description
AnnotateTextResponse

buildPartial()

publicAnnotateTextResponsebuildPartial()
Returns
Type Description
AnnotateTextResponse

clear()

publicAnnotateTextResponse.Builderclear()
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

clearCategories()

publicAnnotateTextResponse.BuilderclearCategories()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
Type Description
AnnotateTextResponse.Builder

clearDocumentSentiment()

publicAnnotateTextResponse.BuilderclearDocumentSentiment()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
Type Description
AnnotateTextResponse.Builder

clearEntities()

publicAnnotateTextResponse.BuilderclearEntities()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Returns
Type Description
AnnotateTextResponse.Builder

clearField(Descriptors.FieldDescriptor field)

publicAnnotateTextResponse.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

clearLanguage()

publicAnnotateTextResponse.BuilderclearLanguage()

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.

string language = 5;

Returns
Type Description
AnnotateTextResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicAnnotateTextResponse.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

clearSentences()

publicAnnotateTextResponse.BuilderclearSentences()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Returns
Type Description
AnnotateTextResponse.Builder

clearTokens()

publicAnnotateTextResponse.BuilderclearTokens()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
Type Description
AnnotateTextResponse.Builder

clone()

publicAnnotateTextResponse.Builderclone()
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

getCategories(int index)

publicClassificationCategorygetCategories(intindex)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
index int
Returns
Type Description
ClassificationCategory

getCategoriesBuilder(int index)

publicClassificationCategory.BuildergetCategoriesBuilder(intindex)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
index int
Returns
Type Description
ClassificationCategory.Builder

getCategoriesBuilderList()

publicList<ClassificationCategory.Builder>getCategoriesBuilderList()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
Type Description
List<Builder>

getCategoriesCount()

publicintgetCategoriesCount()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
Type Description
int

getCategoriesList()

publicList<ClassificationCategory>getCategoriesList()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
Type Description
List<ClassificationCategory>

getCategoriesOrBuilder(int index)

publicClassificationCategoryOrBuildergetCategoriesOrBuilder(intindex)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
index int
Returns
Type Description
ClassificationCategoryOrBuilder

getCategoriesOrBuilderList()

publicList<?extendsClassificationCategoryOrBuilder>getCategoriesOrBuilderList()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
Type Description
List<? extends com.google.cloud.language.v1.ClassificationCategoryOrBuilder>

getDefaultInstanceForType()

publicAnnotateTextResponsegetDefaultInstanceForType()
Returns
Type Description
AnnotateTextResponse

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDocumentSentiment()

publicSentimentgetDocumentSentiment()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
Type Description
Sentiment

The documentSentiment.

getDocumentSentimentBuilder()

publicSentiment.BuildergetDocumentSentimentBuilder()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
Type Description
Sentiment.Builder

getDocumentSentimentOrBuilder()

publicSentimentOrBuildergetDocumentSentimentOrBuilder()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
Type Description
SentimentOrBuilder

getEntities(int index)

publicEntitygetEntities(intindex)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
index int
Returns
Type Description
Entity

getEntitiesBuilder(int index)

publicEntity.BuildergetEntitiesBuilder(intindex)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
index int
Returns
Type Description
Entity.Builder

getEntitiesBuilderList()

publicList<Entity.Builder>getEntitiesBuilderList()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Returns
Type Description
List<Builder>

getEntitiesCount()

publicintgetEntitiesCount()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Returns
Type Description
int

getEntitiesList()

publicList<Entity>getEntitiesList()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Returns
Type Description
List<Entity>

getEntitiesOrBuilder(int index)

publicEntityOrBuildergetEntitiesOrBuilder(intindex)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
index int
Returns
Type Description
EntityOrBuilder

getEntitiesOrBuilderList()

publicList<?extendsEntityOrBuilder>getEntitiesOrBuilderList()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Returns
Type Description
List<? extends com.google.cloud.language.v1.EntityOrBuilder>

getLanguage()

publicStringgetLanguage()

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.

string language = 5;

Returns
Type Description
String

The language.

getLanguageBytes()

publicByteStringgetLanguageBytes()

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.

string language = 5;

Returns
Type Description
ByteString

The bytes for language.

getSentences(int index)

publicSentencegetSentences(intindex)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
index int
Returns
Type Description
Sentence

getSentencesBuilder(int index)

publicSentence.BuildergetSentencesBuilder(intindex)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
index int
Returns
Type Description
Sentence.Builder

getSentencesBuilderList()

publicList<Sentence.Builder>getSentencesBuilderList()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Returns
Type Description
List<Builder>

getSentencesCount()

publicintgetSentencesCount()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Returns
Type Description
int

getSentencesList()

publicList<Sentence>getSentencesList()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Returns
Type Description
List<Sentence>

getSentencesOrBuilder(int index)

publicSentenceOrBuildergetSentencesOrBuilder(intindex)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
index int
Returns
Type Description
SentenceOrBuilder

getSentencesOrBuilderList()

publicList<?extendsSentenceOrBuilder>getSentencesOrBuilderList()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Returns
Type Description
List<? extends com.google.cloud.language.v1.SentenceOrBuilder>

getTokens(int index)

publicTokengetTokens(intindex)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
index int
Returns
Type Description
Token

getTokensBuilder(int index)

publicToken.BuildergetTokensBuilder(intindex)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
index int
Returns
Type Description
Token.Builder

getTokensBuilderList()

publicList<Token.Builder>getTokensBuilderList()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
Type Description
List<Builder>

getTokensCount()

publicintgetTokensCount()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
Type Description
int

getTokensList()

publicList<Token>getTokensList()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
Type Description
List<Token>

getTokensOrBuilder(int index)

publicTokenOrBuildergetTokensOrBuilder(intindex)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
index int
Returns
Type Description
TokenOrBuilder

getTokensOrBuilderList()

publicList<?extendsTokenOrBuilder>getTokensOrBuilderList()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
Type Description
List<? extends com.google.cloud.language.v1.TokenOrBuilder>

hasDocumentSentiment()

publicbooleanhasDocumentSentiment()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
Type Description
boolean

Whether the documentSentiment field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeDocumentSentiment(Sentiment value)

publicAnnotateTextResponse.BuildermergeDocumentSentiment(Sentimentvalue)

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Parameter
Name Description
value Sentiment
Returns
Type Description
AnnotateTextResponse.Builder

mergeFrom(AnnotateTextResponse other)

publicAnnotateTextResponse.BuildermergeFrom(AnnotateTextResponseother)
Parameter
Name Description
other AnnotateTextResponse
Returns
Type Description
AnnotateTextResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicAnnotateTextResponse.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AnnotateTextResponse.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicAnnotateTextResponse.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalAnnotateTextResponse.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

removeCategories(int index)

publicAnnotateTextResponse.BuilderremoveCategories(intindex)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
Name Description
index int
Returns
Type Description
AnnotateTextResponse.Builder

removeEntities(int index)

publicAnnotateTextResponse.BuilderremoveEntities(intindex)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
Name Description
index int
Returns
Type Description
AnnotateTextResponse.Builder

removeSentences(int index)

publicAnnotateTextResponse.BuilderremoveSentences(intindex)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameter
Name Description
index int
Returns
Type Description
AnnotateTextResponse.Builder

removeTokens(int index)

publicAnnotateTextResponse.BuilderremoveTokens(intindex)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
Name Description
index int
Returns
Type Description
AnnotateTextResponse.Builder

setCategories(int index, ClassificationCategory value)

publicAnnotateTextResponse.BuildersetCategories(intindex,ClassificationCategoryvalue)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameters
Name Description
index int
value ClassificationCategory
Returns
Type Description
AnnotateTextResponse.Builder

setCategories(int index, ClassificationCategory.Builder builderForValue)

publicAnnotateTextResponse.BuildersetCategories(intindex,ClassificationCategory.BuilderbuilderForValue)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameters
Name Description
index int
builderForValue ClassificationCategory.Builder
Returns
Type Description
AnnotateTextResponse.Builder

setDocumentSentiment(Sentiment value)

publicAnnotateTextResponse.BuildersetDocumentSentiment(Sentimentvalue)

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Parameter
Name Description
value Sentiment
Returns
Type Description
AnnotateTextResponse.Builder

setDocumentSentiment(Sentiment.Builder builderForValue)

publicAnnotateTextResponse.BuildersetDocumentSentiment(Sentiment.BuilderbuilderForValue)

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Parameter
Name Description
builderForValue Sentiment.Builder
Returns
Type Description
AnnotateTextResponse.Builder

setEntities(int index, Entity value)

publicAnnotateTextResponse.BuildersetEntities(intindex,Entityvalue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameters
Name Description
index int
value Entity
Returns
Type Description
AnnotateTextResponse.Builder

setEntities(int index, Entity.Builder builderForValue)

publicAnnotateTextResponse.BuildersetEntities(intindex,Entity.BuilderbuilderForValue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameters
Name Description
index int
builderForValue Entity.Builder
Returns
Type Description
AnnotateTextResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

publicAnnotateTextResponse.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

setLanguage(String value)

publicAnnotateTextResponse.BuildersetLanguage(Stringvalue)

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.

string language = 5;

Parameter
Name Description
value String

The language to set.

Returns
Type Description
AnnotateTextResponse.Builder

This builder for chaining.

setLanguageBytes(ByteString value)

publicAnnotateTextResponse.BuildersetLanguageBytes(ByteStringvalue)

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.

string language = 5;

Parameter
Name Description
value ByteString

The bytes for language to set.

Returns
Type Description
AnnotateTextResponse.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicAnnotateTextResponse.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

setSentences(int index, Sentence value)

publicAnnotateTextResponse.BuildersetSentences(intindex,Sentencevalue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameters
Name Description
index int
value Sentence
Returns
Type Description
AnnotateTextResponse.Builder

setSentences(int index, Sentence.Builder builderForValue)

publicAnnotateTextResponse.BuildersetSentences(intindex,Sentence.BuilderbuilderForValue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Sentence sentences = 1;

Parameters
Name Description
index int
builderForValue Sentence.Builder
Returns
Type Description
AnnotateTextResponse.Builder

setTokens(int index, Token value)

publicAnnotateTextResponse.BuildersetTokens(intindex,Tokenvalue)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameters
Name Description
index int
value Token
Returns
Type Description
AnnotateTextResponse.Builder

setTokens(int index, Token.Builder builderForValue)

publicAnnotateTextResponse.BuildersetTokens(intindex,Token.BuilderbuilderForValue)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameters
Name Description
index int
builderForValue Token.Builder
Returns
Type Description
AnnotateTextResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalAnnotateTextResponse.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AnnotateTextResponse.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.