Class Sentence.Builder (2.49.0)

public static final class Sentence.Builder extends GeneratedMessageV3.Builder<Sentence.Builder> implements SentenceOrBuilder

Represents a sentence in the input document.

Protobuf type google.cloud.language.v1beta2.Sentence

Implements

SentenceOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Sentence.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Sentence.Builder
Overrides

build()

public Sentence build()
Returns
Type Description
Sentence

buildPartial()

public Sentence buildPartial()
Returns
Type Description
Sentence

clear()

public Sentence.Builder clear()
Returns
Type Description
Sentence.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Sentence.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Sentence.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Sentence.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Sentence.Builder
Overrides

clearSentiment()

public Sentence.Builder clearSentiment()

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.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
Sentence.Builder

clearText()

public Sentence.Builder clearText()

The sentence text.

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

Returns
Type Description
Sentence.Builder

clone()

public Sentence.Builder clone()
Returns
Type Description
Sentence.Builder
Overrides

getDefaultInstanceForType()

public Sentence getDefaultInstanceForType()
Returns
Type Description
Sentence

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getSentiment()

public Sentiment getSentiment()

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.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
Sentiment

The sentiment.

getSentimentBuilder()

public Sentiment.Builder getSentimentBuilder()

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.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
Sentiment.Builder

getSentimentOrBuilder()

public SentimentOrBuilder getSentimentOrBuilder()

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.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
SentimentOrBuilder

getText()

public TextSpan getText()

The sentence text.

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

Returns
Type Description
TextSpan

The text.

getTextBuilder()

public TextSpan.Builder getTextBuilder()

The sentence text.

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

Returns
Type Description
TextSpan.Builder

getTextOrBuilder()

public TextSpanOrBuilder getTextOrBuilder()

The sentence text.

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

Returns
Type Description
TextSpanOrBuilder

hasSentiment()

public boolean hasSentiment()

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.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
boolean

Whether the sentiment field is set.

hasText()

public boolean hasText()

The sentence text.

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

Returns
Type Description
boolean

Whether the text field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Sentence other)

public Sentence.Builder mergeFrom(Sentence other)
Parameter
Name Description
other Sentence
Returns
Type Description
Sentence.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Sentence.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sentence.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Sentence.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Sentence.Builder
Overrides

mergeSentiment(Sentiment value)

public Sentence.Builder mergeSentiment(Sentiment value)

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.v1beta2.Sentiment sentiment = 2;

Parameter
Name Description
value Sentiment
Returns
Type Description
Sentence.Builder

mergeText(TextSpan value)

public Sentence.Builder mergeText(TextSpan value)

The sentence text.

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

Parameter
Name Description
value TextSpan
Returns
Type Description
Sentence.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Sentence.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Sentence.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public Sentence.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Sentence.Builder
Overrides

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

public Sentence.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Sentence.Builder
Overrides

setSentiment(Sentiment value)

public Sentence.Builder setSentiment(Sentiment value)

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.v1beta2.Sentiment sentiment = 2;

Parameter
Name Description
value Sentiment
Returns
Type Description
Sentence.Builder

setSentiment(Sentiment.Builder builderForValue)

public Sentence.Builder setSentiment(Sentiment.Builder builderForValue)

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.v1beta2.Sentiment sentiment = 2;

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

setText(TextSpan value)

public Sentence.Builder setText(TextSpan value)

The sentence text.

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

Parameter
Name Description
value TextSpan
Returns
Type Description
Sentence.Builder

setText(TextSpan.Builder builderForValue)

public Sentence.Builder setText(TextSpan.Builder builderForValue)

The sentence text.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

public final Sentence.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Sentence.Builder
Overrides