Class Sentiment.Builder (2.54.0)

publicstaticfinalclass Sentiment.BuilderextendsGeneratedMessageV3.Builder<Sentiment.Builder>implementsSentimentOrBuilder

Represents the feeling associated with the entire text or entities in the text.

Protobuf type google.cloud.language.v2.Sentiment

Implements

SentimentOrBuilder

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

publicSentimentbuild()
Returns
Type Description
Sentiment

buildPartial()

publicSentimentbuildPartial()
Returns
Type Description
Sentiment

clear()

publicSentiment.Builderclear()
Returns
Type Description
Sentiment.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

publicSentiment.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Sentiment.Builder
Overrides

clearMagnitude()

publicSentiment.BuilderclearMagnitude()

A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).

float magnitude = 1;

Returns
Type Description
Sentiment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicSentiment.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Sentiment.Builder
Overrides

clearScore()

publicSentiment.BuilderclearScore()

Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).

float score = 2;

Returns
Type Description
Sentiment.Builder

This builder for chaining.

clone()

publicSentiment.Builderclone()
Returns
Type Description
Sentiment.Builder
Overrides

getDefaultInstanceForType()

publicSentimentgetDefaultInstanceForType()
Returns
Type Description
Sentiment

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMagnitude()

publicfloatgetMagnitude()

A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).

float magnitude = 1;

Returns
Type Description
float

The magnitude.

getScore()

publicfloatgetScore()

Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).

float score = 2;

Returns
Type Description
float

The score.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Sentiment other)

publicSentiment.BuildermergeFrom(Sentimentother)
Parameter
Name Description
other Sentiment
Returns
Type Description
Sentiment.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

publicSentiment.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Sentiment.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalSentiment.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Sentiment.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setMagnitude(float value)

publicSentiment.BuildersetMagnitude(floatvalue)

A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).

float magnitude = 1;

Parameter
Name Description
value float

The magnitude to set.

Returns
Type Description
Sentiment.Builder

This builder for chaining.

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

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

setScore(float value)

publicSentiment.BuildersetScore(floatvalue)

Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).

float score = 2;

Parameter
Name Description
value float

The score to set.

Returns
Type Description
Sentiment.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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