Class AnalyzeSentimentResponse.Builder (2.13.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.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

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicAnalyzeSentimentResponse.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
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

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

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

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

addSentencesBuilder()

publicSentence.BuilderaddSentencesBuilder()

The sentiment for all the sentences in the document.

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

Returns
Type Description

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

build()

publicAnalyzeSentimentResponsebuild()
Returns
Type Description

buildPartial()

publicAnalyzeSentimentResponsebuildPartial()
Returns
Type Description

clear()

publicAnalyzeSentimentResponse.Builderclear()
Returns
Type Description
Overrides

clearDocumentSentiment()

publicAnalyzeSentimentResponse.BuilderclearDocumentSentiment()

The overall sentiment of the input document.

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

Returns
Type Description

clearField(Descriptors.FieldDescriptor field)

publicAnalyzeSentimentResponse.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
Returns
Type Description
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
Returns
Type Description
Overrides

clearSentences()

publicAnalyzeSentimentResponse.BuilderclearSentences()

The sentiment for all the sentences in the document.

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

Returns
Type Description

clone()

publicAnalyzeSentimentResponse.Builderclone()
Returns
Type Description
Overrides

getDefaultInstanceForType()

publicAnalyzeSentimentResponsegetDefaultInstanceForType()
Returns
Type Description

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
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

getDocumentSentimentOrBuilder()

publicSentimentOrBuildergetDocumentSentimentOrBuilder()

The overall sentiment of the input document.

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

Returns
Type Description

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

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

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

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

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

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
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
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

mergeFrom(AnalyzeSentimentResponse other)

publicAnalyzeSentimentResponse.BuildermergeFrom(AnalyzeSentimentResponseother)
Parameter
Name Description
Returns
Type Description

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicAnalyzeSentimentResponse.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Overrides Exceptions
Type Description

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

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

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

setField(Descriptors.FieldDescriptor field, Object value)

publicAnalyzeSentimentResponse.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
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
index int
value Object
Returns
Type Description
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

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

setUnknownFields(UnknownFieldSet unknownFields)

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