Class Sentence.Builder (2.31.0)

publicstaticfinalclass Sentence.BuilderextendsGeneratedMessageV3.Builder<Sentence.Builder>implementsSentenceOrBuilder

Represents a sentence in the input document.

Protobuf type google.cloud.language.v1.Sentence

Implements

SentenceOrBuilder

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

publicSentencebuild()
Returns
Type Description
Sentence

buildPartial()

publicSentencebuildPartial()
Returns
Type Description
Sentence

clear()

publicSentence.Builderclear()
Returns
Type Description
Sentence.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

publicSentence.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Sentence.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicSentence.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Sentence.Builder
Overrides

clearSentiment()

publicSentence.BuilderclearSentiment()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Returns
Type Description
Sentence.Builder

clearText()

publicSentence.BuilderclearText()

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Returns
Type Description
Sentence.Builder

clone()

publicSentence.Builderclone()
Returns
Type Description
Sentence.Builder
Overrides

getDefaultInstanceForType()

publicSentencegetDefaultInstanceForType()
Returns
Type Description
Sentence

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getSentiment()

publicSentimentgetSentiment()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Returns
Type Description
Sentiment

The sentiment.

getSentimentBuilder()

publicSentiment.BuildergetSentimentBuilder()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Returns
Type Description
Sentiment.Builder

getSentimentOrBuilder()

publicSentimentOrBuildergetSentimentOrBuilder()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Returns
Type Description
SentimentOrBuilder

getText()

publicTextSpangetText()

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Returns
Type Description
TextSpan

The text.

getTextBuilder()

publicTextSpan.BuildergetTextBuilder()

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Returns
Type Description
TextSpan.Builder

getTextOrBuilder()

publicTextSpanOrBuildergetTextOrBuilder()

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Returns
Type Description
TextSpanOrBuilder

hasSentiment()

publicbooleanhasSentiment()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Returns
Type Description
boolean

Whether the sentiment field is set.

hasText()

publicbooleanhasText()

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Returns
Type Description
boolean

Whether the text field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Sentence other)

publicSentence.BuildermergeFrom(Sentenceother)
Parameter
Name Description
other Sentence
Returns
Type Description
Sentence.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

publicSentence.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Sentence.Builder
Overrides

mergeSentiment(Sentiment value)

publicSentence.BuildermergeSentiment(Sentimentvalue)

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Parameter
Name Description
value Sentiment
Returns
Type Description
Sentence.Builder

mergeText(TextSpan value)

publicSentence.BuildermergeText(TextSpanvalue)

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Parameter
Name Description
value TextSpan
Returns
Type Description
Sentence.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalSentence.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Sentence.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setSentiment(Sentiment value)

publicSentence.BuildersetSentiment(Sentimentvalue)

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

Parameter
Name Description
value Sentiment
Returns
Type Description
Sentence.Builder

setSentiment(Sentiment.Builder builderForValue)

publicSentence.BuildersetSentiment(Sentiment.BuilderbuilderForValue)

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1.Sentiment sentiment = 2;

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

setText(TextSpan value)

publicSentence.BuildersetText(TextSpanvalue)

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

Parameter
Name Description
value TextSpan
Returns
Type Description
Sentence.Builder

setText(TextSpan.Builder builderForValue)

publicSentence.BuildersetText(TextSpan.BuilderbuilderForValue)

The sentence text.

.google.cloud.language.v1.TextSpan text = 1;

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

setUnknownFields(UnknownFieldSet unknownFields)

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