Class Sentence.Builder (2.7.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.v1.Sentence

Implements

SentenceOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Sentence build()
Returns
TypeDescription
Sentence

buildPartial()

public Sentence buildPartial()
Returns
TypeDescription
Sentence

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

public Sentence.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Returns
TypeDescription
Sentence.Builder

clearText()

public Sentence.Builder clearText()

The sentence text.

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

Returns
TypeDescription
Sentence.Builder

clone()

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

getDefaultInstanceForType()

public Sentence getDefaultInstanceForType()
Returns
TypeDescription
Sentence

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Returns
TypeDescription
SentimentOrBuilder

getText()

public TextSpan getText()

The sentence text.

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

Returns
TypeDescription
TextSpan

The text.

getTextBuilder()

public TextSpan.Builder getTextBuilder()

The sentence text.

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

Returns
TypeDescription
TextSpan.Builder

getTextOrBuilder()

public TextSpanOrBuilder getTextOrBuilder()

The sentence text.

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

Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Returns
TypeDescription
boolean

Whether the sentiment field is set.

hasText()

public boolean hasText()

The sentence text.

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

Returns
TypeDescription
boolean

Whether the text field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Sentence other)

public Sentence.Builder mergeFrom(Sentence other)
Parameter
NameDescription
otherSentence
Returns
TypeDescription
Sentence.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Sentence.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
Sentence.Builder

mergeText(TextSpan value)

public Sentence.Builder mergeText(TextSpan value)

The sentence text.

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

Parameter
NameDescription
valueTextSpan
Returns
TypeDescription
Sentence.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public Sentence.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
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.v1.Sentiment sentiment = 2;

Parameter
NameDescription
builderForValueSentiment.Builder
Returns
TypeDescription
Sentence.Builder

setText(TextSpan value)

public Sentence.Builder setText(TextSpan value)

The sentence text.

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

Parameter
NameDescription
valueTextSpan
Returns
TypeDescription
Sentence.Builder

setText(TextSpan.Builder builderForValue)

public Sentence.Builder setText(TextSpan.Builder builderForValue)

The sentence text.

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

Parameter
NameDescription
builderForValueTextSpan.Builder
Returns
TypeDescription
Sentence.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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