Class AnalyzeSentimentResponse.Builder (2.22.0)

public static final class AnalyzeSentimentResponse.Builder extends GeneratedMessageV3.Builder<AnalyzeSentimentResponse.Builder> implements AnalyzeSentimentResponseOrBuilder

The sentiment analysis response message.

Protobuf type google.cloud.language.v1.AnalyzeSentimentResponse

Static Methods

getDescriptor()

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

Methods

addAllSentences(Iterable<? extends Sentence> values)

public AnalyzeSentimentResponse.Builder addAllSentences(Iterable<? extends Sentence> values)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.language.v1.Sentence>
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AnalyzeSentimentResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

addSentences(Sentence value)

public AnalyzeSentimentResponse.Builder addSentences(Sentence value)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
valueSentence
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

addSentences(Sentence.Builder builderForValue)

public AnalyzeSentimentResponse.Builder addSentences(Sentence.Builder builderForValue)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
builderForValueSentence.Builder
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

addSentences(int index, Sentence value)

public AnalyzeSentimentResponse.Builder addSentences(int index, Sentence value)

The sentiment for all the sentences in the document.

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

Parameters
NameDescription
indexint
valueSentence
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

addSentences(int index, Sentence.Builder builderForValue)

public AnalyzeSentimentResponse.Builder addSentences(int index, Sentence.Builder builderForValue)

The sentiment for all the sentences in the document.

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

Parameters
NameDescription
indexint
builderForValueSentence.Builder
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

addSentencesBuilder()

public Sentence.Builder addSentencesBuilder()

The sentiment for all the sentences in the document.

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

Returns
TypeDescription
Sentence.Builder

addSentencesBuilder(int index)

public Sentence.Builder addSentencesBuilder(int index)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence.Builder

build()

public AnalyzeSentimentResponse build()
Returns
TypeDescription
AnalyzeSentimentResponse

buildPartial()

public AnalyzeSentimentResponse buildPartial()
Returns
TypeDescription
AnalyzeSentimentResponse

clear()

public AnalyzeSentimentResponse.Builder clear()
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

clearDocumentSentiment()

public AnalyzeSentimentResponse.Builder clearDocumentSentiment()

The overall sentiment of the input document.

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

Returns
TypeDescription
AnalyzeSentimentResponse.Builder

clearField(Descriptors.FieldDescriptor field)

public AnalyzeSentimentResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

clearLanguage()

public AnalyzeSentimentResponse.Builder clearLanguage()

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
TypeDescription
AnalyzeSentimentResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public AnalyzeSentimentResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

clearSentences()

public AnalyzeSentimentResponse.Builder clearSentences()

The sentiment for all the sentences in the document.

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

Returns
TypeDescription
AnalyzeSentimentResponse.Builder

clone()

public AnalyzeSentimentResponse.Builder clone()
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

getDefaultInstanceForType()

public AnalyzeSentimentResponse getDefaultInstanceForType()
Returns
TypeDescription
AnalyzeSentimentResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDocumentSentiment()

public Sentiment getDocumentSentiment()

The overall sentiment of the input document.

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

Returns
TypeDescription
Sentiment

The documentSentiment.

getDocumentSentimentBuilder()

public Sentiment.Builder getDocumentSentimentBuilder()

The overall sentiment of the input document.

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

Returns
TypeDescription
Sentiment.Builder

getDocumentSentimentOrBuilder()

public SentimentOrBuilder getDocumentSentimentOrBuilder()

The overall sentiment of the input document.

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

Returns
TypeDescription
SentimentOrBuilder

getLanguage()

public String getLanguage()

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
TypeDescription
String

The language.

getLanguageBytes()

public ByteString getLanguageBytes()

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
TypeDescription
ByteString

The bytes for language.

getSentences(int index)

public Sentence getSentences(int index)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence

getSentencesBuilder(int index)

public Sentence.Builder getSentencesBuilder(int index)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence.Builder

getSentencesBuilderList()

public List<Sentence.Builder> getSentencesBuilderList()

The sentiment for all the sentences in the document.

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

Returns
TypeDescription
List<Builder>

getSentencesCount()

public int getSentencesCount()

The sentiment for all the sentences in the document.

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

Returns
TypeDescription
int

getSentencesList()

public List<Sentence> getSentencesList()

The sentiment for all the sentences in the document.

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

Returns
TypeDescription
List<Sentence>

getSentencesOrBuilder(int index)

public SentenceOrBuilder getSentencesOrBuilder(int index)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
SentenceOrBuilder

getSentencesOrBuilderList()

public List<? extends SentenceOrBuilder> getSentencesOrBuilderList()

The sentiment for all the sentences in the document.

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

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

hasDocumentSentiment()

public boolean hasDocumentSentiment()

The overall sentiment of the input document.

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

Returns
TypeDescription
boolean

Whether the documentSentiment field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeDocumentSentiment(Sentiment value)

public AnalyzeSentimentResponse.Builder mergeDocumentSentiment(Sentiment value)

The overall sentiment of the input document.

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

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

mergeFrom(AnalyzeSentimentResponse other)

public AnalyzeSentimentResponse.Builder mergeFrom(AnalyzeSentimentResponse other)
Parameter
NameDescription
otherAnalyzeSentimentResponse
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AnalyzeSentimentResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public AnalyzeSentimentResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AnalyzeSentimentResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

removeSentences(int index)

public AnalyzeSentimentResponse.Builder removeSentences(int index)

The sentiment for all the sentences in the document.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

setDocumentSentiment(Sentiment value)

public AnalyzeSentimentResponse.Builder setDocumentSentiment(Sentiment value)

The overall sentiment of the input document.

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

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

setDocumentSentiment(Sentiment.Builder builderForValue)

public AnalyzeSentimentResponse.Builder setDocumentSentiment(Sentiment.Builder builderForValue)

The overall sentiment of the input document.

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

Parameter
NameDescription
builderForValueSentiment.Builder
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public AnalyzeSentimentResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

setLanguage(String value)

public AnalyzeSentimentResponse.Builder setLanguage(String value)

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
NameDescription
valueString

The language to set.

Returns
TypeDescription
AnalyzeSentimentResponse.Builder

This builder for chaining.

setLanguageBytes(ByteString value)

public AnalyzeSentimentResponse.Builder setLanguageBytes(ByteString value)

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
NameDescription
valueByteString

The bytes for language to set.

Returns
TypeDescription
AnalyzeSentimentResponse.Builder

This builder for chaining.

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

public AnalyzeSentimentResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides

setSentences(int index, Sentence value)

public AnalyzeSentimentResponse.Builder setSentences(int index, Sentence value)

The sentiment for all the sentences in the document.

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

Parameters
NameDescription
indexint
valueSentence
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

setSentences(int index, Sentence.Builder builderForValue)

public AnalyzeSentimentResponse.Builder setSentences(int index, Sentence.Builder builderForValue)

The sentiment for all the sentences in the document.

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

Parameters
NameDescription
indexint
builderForValueSentence.Builder
Returns
TypeDescription
AnalyzeSentimentResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final AnalyzeSentimentResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AnalyzeSentimentResponse.Builder
Overrides