Class AnalyzeSentimentResponse.Builder (2.55.0)

publicstaticfinalclass AnalyzeSentimentResponse.BuilderextendsGeneratedMessageV3.Builder<AnalyzeSentimentResponse.Builder>implementsAnalyzeSentimentResponseOrBuilder

The sentiment analysis response message.

Protobuf type google.cloud.language.v1.AnalyzeSentimentResponse

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
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

addAllSentences(Iterable<? extends Sentence> values)

publicAnalyzeSentimentResponse.BuilderaddAllSentences(Iterable<?extendsSentence>values)

The sentiment for all the sentences in the document.

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

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addSentences(Sentence value)

publicAnalyzeSentimentResponse.BuilderaddSentences(Sentencevalue)

The sentiment for all the sentences in the document.

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

Parameter
Name Description
value Sentence
Returns
Type Description
AnalyzeSentimentResponse.Builder

addSentences(Sentence.Builder builderForValue)

publicAnalyzeSentimentResponse.BuilderaddSentences(Sentence.BuilderbuilderForValue)

The sentiment for all the sentences in the document.

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

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

addSentences(int index, Sentence value)

publicAnalyzeSentimentResponse.BuilderaddSentences(intindex,Sentencevalue)

The sentiment for all the sentences in the document.

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

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

addSentences(int index, Sentence.Builder builderForValue)

publicAnalyzeSentimentResponse.BuilderaddSentences(intindex,Sentence.BuilderbuilderForValue)

The sentiment for all the sentences in the document.

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

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

addSentencesBuilder()

publicSentence.BuilderaddSentencesBuilder()

The sentiment for all the sentences in the document.

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

Returns
Type Description
Sentence.Builder

addSentencesBuilder(int index)

publicSentence.BuilderaddSentencesBuilder(intindex)

The sentiment for all the sentences in the document.

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

Parameter
Name Description
index int
Returns
Type Description
Sentence.Builder

build()

publicAnalyzeSentimentResponsebuild()
Returns
Type Description
AnalyzeSentimentResponse

buildPartial()

publicAnalyzeSentimentResponsebuildPartial()
Returns
Type Description
AnalyzeSentimentResponse

clear()

publicAnalyzeSentimentResponse.Builderclear()
Returns
Type Description
AnalyzeSentimentResponse.Builder
Overrides

clearDocumentSentiment()

publicAnalyzeSentimentResponse.BuilderclearDocumentSentiment()

The overall sentiment of the input document.

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

Returns
Type Description
AnalyzeSentimentResponse.Builder

clearField(Descriptors.FieldDescriptor field)

publicAnalyzeSentimentResponse.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AnalyzeSentimentResponse.Builder
Overrides

clearLanguage()

publicAnalyzeSentimentResponse.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 = 2;

Returns
Type Description
AnalyzeSentimentResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicAnalyzeSentimentResponse.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AnalyzeSentimentResponse.Builder
Overrides

clearSentences()

publicAnalyzeSentimentResponse.BuilderclearSentences()

The sentiment for all the sentences in the document.

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

Returns
Type Description
AnalyzeSentimentResponse.Builder

clone()

publicAnalyzeSentimentResponse.Builderclone()
Returns
Type Description
AnalyzeSentimentResponse.Builder
Overrides

getDefaultInstanceForType()

publicAnalyzeSentimentResponsegetDefaultInstanceForType()
Returns
Type Description
AnalyzeSentimentResponse

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDocumentSentiment()

publicSentimentgetDocumentSentiment()

The overall sentiment of the input document.

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

Returns
Type Description
Sentiment

The documentSentiment.

getDocumentSentimentBuilder()

publicSentiment.BuildergetDocumentSentimentBuilder()

The overall sentiment of the input document.

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

Returns
Type Description
Sentiment.Builder

getDocumentSentimentOrBuilder()

publicSentimentOrBuildergetDocumentSentimentOrBuilder()

The overall sentiment of the input document.

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

Returns
Type Description
SentimentOrBuilder

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 = 2;

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 = 2;

Returns
Type Description
ByteString

The bytes for language.

getSentences(int index)

publicSentencegetSentences(intindex)

The sentiment for all the sentences in the document.

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

Parameter
Name Description
index int
Returns
Type Description
Sentence

getSentencesBuilder(int index)

publicSentence.BuildergetSentencesBuilder(intindex)

The sentiment for all the sentences in the document.

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

Parameter
Name Description
index int
Returns
Type Description
Sentence.Builder

getSentencesBuilderList()

publicList<Sentence.Builder>getSentencesBuilderList()

The sentiment for all the sentences in the document.

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

Returns
Type Description
List<Builder>

getSentencesCount()

publicintgetSentencesCount()

The sentiment for all the sentences in the document.

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

Returns
Type Description
int

getSentencesList()

publicList<Sentence>getSentencesList()

The sentiment for all the sentences in the document.

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

Returns
Type Description
List<Sentence>

getSentencesOrBuilder(int index)

publicSentenceOrBuildergetSentencesOrBuilder(intindex)

The sentiment for all the sentences in the document.

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

Parameter
Name Description
index int
Returns
Type Description
SentenceOrBuilder

getSentencesOrBuilderList()

publicList<?extendsSentenceOrBuilder>getSentencesOrBuilderList()

The sentiment for all the sentences in the document.

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

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

hasDocumentSentiment()

publicbooleanhasDocumentSentiment()

The overall sentiment of the input document.

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

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)

publicAnalyzeSentimentResponse.BuildermergeDocumentSentiment(Sentimentvalue)

The overall sentiment of the input document.

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

Parameter
Name Description
value Sentiment
Returns
Type Description
AnalyzeSentimentResponse.Builder

mergeFrom(AnalyzeSentimentResponse other)

publicAnalyzeSentimentResponse.BuildermergeFrom(AnalyzeSentimentResponseother)
Parameter
Name Description
other AnalyzeSentimentResponse
Returns
Type Description
AnalyzeSentimentResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

publicAnalyzeSentimentResponse.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
AnalyzeSentimentResponse.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalAnalyzeSentimentResponse.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AnalyzeSentimentResponse.Builder
Overrides

removeSentences(int index)

publicAnalyzeSentimentResponse.BuilderremoveSentences(intindex)

The sentiment for all the sentences in the document.

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

Parameter
Name Description
index int
Returns
Type Description
AnalyzeSentimentResponse.Builder

setDocumentSentiment(Sentiment value)

publicAnalyzeSentimentResponse.BuildersetDocumentSentiment(Sentimentvalue)

The overall sentiment of the input document.

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

Parameter
Name Description
value Sentiment
Returns
Type Description
AnalyzeSentimentResponse.Builder

setDocumentSentiment(Sentiment.Builder builderForValue)

publicAnalyzeSentimentResponse.BuildersetDocumentSentiment(Sentiment.BuilderbuilderForValue)

The overall sentiment of the input document.

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

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setLanguage(String value)

publicAnalyzeSentimentResponse.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 = 2;

Parameter
Name Description
value String

The language to set.

Returns
Type Description
AnalyzeSentimentResponse.Builder

This builder for chaining.

setLanguageBytes(ByteString value)

publicAnalyzeSentimentResponse.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 = 2;

Parameter
Name Description
value ByteString

The bytes for language to set.

Returns
Type Description
AnalyzeSentimentResponse.Builder

This builder for chaining.

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

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

setSentences(int index, Sentence value)

publicAnalyzeSentimentResponse.BuildersetSentences(intindex,Sentencevalue)

The sentiment for all the sentences in the document.

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

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

setSentences(int index, Sentence.Builder builderForValue)

publicAnalyzeSentimentResponse.BuildersetSentences(intindex,Sentence.BuilderbuilderForValue)

The sentiment for all the sentences in the document.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalAnalyzeSentimentResponse.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AnalyzeSentimentResponse.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.