Class AnnotateTextResponse.Builder (2.33.0)

public static final class AnnotateTextResponse.Builder extends GeneratedMessageV3.Builder<AnnotateTextResponse.Builder> implements AnnotateTextResponseOrBuilder

The text annotations response message.

Protobuf type google.cloud.language.v2.AnnotateTextResponse

Static Methods

getDescriptor()

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

Methods

addAllCategories(Iterable<? extends ClassificationCategory> values)

public AnnotateTextResponse.Builder addAllCategories(Iterable<? extends ClassificationCategory> values)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.language.v2.ClassificationCategory>
Returns
TypeDescription
AnnotateTextResponse.Builder

addAllEntities(Iterable<? extends Entity> values)

public AnnotateTextResponse.Builder addAllEntities(Iterable<? extends Entity> values)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.language.v2.Entity>
Returns
TypeDescription
AnnotateTextResponse.Builder

addAllModerationCategories(Iterable<? extends ClassificationCategory> values)

public AnnotateTextResponse.Builder addAllModerationCategories(Iterable<? extends ClassificationCategory> values)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.language.v2.ClassificationCategory>
Returns
TypeDescription
AnnotateTextResponse.Builder

addAllSentences(Iterable<? extends Sentence> values)

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

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

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

addCategories(ClassificationCategory value)

public AnnotateTextResponse.Builder addCategories(ClassificationCategory value)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
valueClassificationCategory
Returns
TypeDescription
AnnotateTextResponse.Builder

addCategories(ClassificationCategory.Builder builderForValue)

public AnnotateTextResponse.Builder addCategories(ClassificationCategory.Builder builderForValue)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
builderForValueClassificationCategory.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addCategories(int index, ClassificationCategory value)

public AnnotateTextResponse.Builder addCategories(int index, ClassificationCategory value)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameters
NameDescription
indexint
valueClassificationCategory
Returns
TypeDescription
AnnotateTextResponse.Builder

addCategories(int index, ClassificationCategory.Builder builderForValue)

public AnnotateTextResponse.Builder addCategories(int index, ClassificationCategory.Builder builderForValue)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameters
NameDescription
indexint
builderForValueClassificationCategory.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addCategoriesBuilder()

public ClassificationCategory.Builder addCategoriesBuilder()

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Returns
TypeDescription
ClassificationCategory.Builder

addCategoriesBuilder(int index)

public ClassificationCategory.Builder addCategoriesBuilder(int index)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory.Builder

addEntities(Entity value)

public AnnotateTextResponse.Builder addEntities(Entity value)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
valueEntity
Returns
TypeDescription
AnnotateTextResponse.Builder

addEntities(Entity.Builder builderForValue)

public AnnotateTextResponse.Builder addEntities(Entity.Builder builderForValue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
builderForValueEntity.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addEntities(int index, Entity value)

public AnnotateTextResponse.Builder addEntities(int index, Entity value)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameters
NameDescription
indexint
valueEntity
Returns
TypeDescription
AnnotateTextResponse.Builder

addEntities(int index, Entity.Builder builderForValue)

public AnnotateTextResponse.Builder addEntities(int index, Entity.Builder builderForValue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameters
NameDescription
indexint
builderForValueEntity.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addEntitiesBuilder()

public Entity.Builder addEntitiesBuilder()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Returns
TypeDescription
Entity.Builder

addEntitiesBuilder(int index)

public Entity.Builder addEntitiesBuilder(int index)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Entity.Builder

addModerationCategories(ClassificationCategory value)

public AnnotateTextResponse.Builder addModerationCategories(ClassificationCategory value)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
valueClassificationCategory
Returns
TypeDescription
AnnotateTextResponse.Builder

addModerationCategories(ClassificationCategory.Builder builderForValue)

public AnnotateTextResponse.Builder addModerationCategories(ClassificationCategory.Builder builderForValue)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
builderForValueClassificationCategory.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addModerationCategories(int index, ClassificationCategory value)

public AnnotateTextResponse.Builder addModerationCategories(int index, ClassificationCategory value)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameters
NameDescription
indexint
valueClassificationCategory
Returns
TypeDescription
AnnotateTextResponse.Builder

addModerationCategories(int index, ClassificationCategory.Builder builderForValue)

public AnnotateTextResponse.Builder addModerationCategories(int index, ClassificationCategory.Builder builderForValue)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameters
NameDescription
indexint
builderForValueClassificationCategory.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addModerationCategoriesBuilder()

public ClassificationCategory.Builder addModerationCategoriesBuilder()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Returns
TypeDescription
ClassificationCategory.Builder

addModerationCategoriesBuilder(int index)

public ClassificationCategory.Builder addModerationCategoriesBuilder(int index)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addSentences(Sentence value)

public AnnotateTextResponse.Builder addSentences(Sentence value)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
valueSentence
Returns
TypeDescription
AnnotateTextResponse.Builder

addSentences(Sentence.Builder builderForValue)

public AnnotateTextResponse.Builder addSentences(Sentence.Builder builderForValue)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
builderForValueSentence.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addSentences(int index, Sentence value)

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

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameters
NameDescription
indexint
valueSentence
Returns
TypeDescription
AnnotateTextResponse.Builder

addSentences(int index, Sentence.Builder builderForValue)

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

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameters
NameDescription
indexint
builderForValueSentence.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

addSentencesBuilder()

public Sentence.Builder addSentencesBuilder()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Returns
TypeDescription
Sentence.Builder

addSentencesBuilder(int index)

public Sentence.Builder addSentencesBuilder(int index)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence.Builder

build()

public AnnotateTextResponse build()
Returns
TypeDescription
AnnotateTextResponse

buildPartial()

public AnnotateTextResponse buildPartial()
Returns
TypeDescription
AnnotateTextResponse

clear()

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

clearCategories()

public AnnotateTextResponse.Builder clearCategories()

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Returns
TypeDescription
AnnotateTextResponse.Builder

clearDocumentSentiment()

public AnnotateTextResponse.Builder clearDocumentSentiment()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Returns
TypeDescription
AnnotateTextResponse.Builder

clearEntities()

public AnnotateTextResponse.Builder clearEntities()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Returns
TypeDescription
AnnotateTextResponse.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearLanguageCode()

public AnnotateTextResponse.Builder clearLanguageCode()

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_code = 4;

Returns
TypeDescription
AnnotateTextResponse.Builder

This builder for chaining.

clearLanguageSupported()

public AnnotateTextResponse.Builder clearLanguageSupported()

Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.

bool language_supported = 7;

Returns
TypeDescription
AnnotateTextResponse.Builder

This builder for chaining.

clearModerationCategories()

public AnnotateTextResponse.Builder clearModerationCategories()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Returns
TypeDescription
AnnotateTextResponse.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSentences()

public AnnotateTextResponse.Builder clearSentences()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Returns
TypeDescription
AnnotateTextResponse.Builder

clone()

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

getCategories(int index)

public ClassificationCategory getCategories(int index)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory

getCategoriesBuilder(int index)

public ClassificationCategory.Builder getCategoriesBuilder(int index)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory.Builder

getCategoriesBuilderList()

public List<ClassificationCategory.Builder> getCategoriesBuilderList()

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Returns
TypeDescription
List<Builder>

getCategoriesCount()

public int getCategoriesCount()

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Returns
TypeDescription
int

getCategoriesList()

public List<ClassificationCategory> getCategoriesList()

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Returns
TypeDescription
List<ClassificationCategory>

getCategoriesOrBuilder(int index)

public ClassificationCategoryOrBuilder getCategoriesOrBuilder(int index)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategoryOrBuilder

getCategoriesOrBuilderList()

public List<? extends ClassificationCategoryOrBuilder> getCategoriesOrBuilderList()

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Returns
TypeDescription
List<? extends com.google.cloud.language.v2.ClassificationCategoryOrBuilder>

getDefaultInstanceForType()

public AnnotateTextResponse getDefaultInstanceForType()
Returns
TypeDescription
AnnotateTextResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDocumentSentiment()

public Sentiment getDocumentSentiment()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Returns
TypeDescription
Sentiment

The documentSentiment.

getDocumentSentimentBuilder()

public Sentiment.Builder getDocumentSentimentBuilder()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Returns
TypeDescription
Sentiment.Builder

getDocumentSentimentOrBuilder()

public SentimentOrBuilder getDocumentSentimentOrBuilder()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Returns
TypeDescription
SentimentOrBuilder

getEntities(int index)

public Entity getEntities(int index)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Entity

getEntitiesBuilder(int index)

public Entity.Builder getEntitiesBuilder(int index)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Entity.Builder

getEntitiesBuilderList()

public List<Entity.Builder> getEntitiesBuilderList()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Returns
TypeDescription
List<Builder>

getEntitiesCount()

public int getEntitiesCount()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Returns
TypeDescription
int

getEntitiesList()

public List<Entity> getEntitiesList()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Returns
TypeDescription
List<Entity>

getEntitiesOrBuilder(int index)

public EntityOrBuilder getEntitiesOrBuilder(int index)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
EntityOrBuilder

getEntitiesOrBuilderList()

public List<? extends EntityOrBuilder> getEntitiesOrBuilderList()

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Returns
TypeDescription
List<? extends com.google.cloud.language.v2.EntityOrBuilder>

getLanguageCode()

public String getLanguageCode()

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_code = 4;

Returns
TypeDescription
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

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_code = 4;

Returns
TypeDescription
ByteString

The bytes for languageCode.

getLanguageSupported()

public boolean getLanguageSupported()

Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.

bool language_supported = 7;

Returns
TypeDescription
boolean

The languageSupported.

getModerationCategories(int index)

public ClassificationCategory getModerationCategories(int index)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory

getModerationCategoriesBuilder(int index)

public ClassificationCategory.Builder getModerationCategoriesBuilder(int index)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory.Builder

getModerationCategoriesBuilderList()

public List<ClassificationCategory.Builder> getModerationCategoriesBuilderList()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Returns
TypeDescription
List<Builder>

getModerationCategoriesCount()

public int getModerationCategoriesCount()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Returns
TypeDescription
int

getModerationCategoriesList()

public List<ClassificationCategory> getModerationCategoriesList()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Returns
TypeDescription
List<ClassificationCategory>

getModerationCategoriesOrBuilder(int index)

public ClassificationCategoryOrBuilder getModerationCategoriesOrBuilder(int index)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategoryOrBuilder

getModerationCategoriesOrBuilderList()

public List<? extends ClassificationCategoryOrBuilder> getModerationCategoriesOrBuilderList()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Returns
TypeDescription
List<? extends com.google.cloud.language.v2.ClassificationCategoryOrBuilder>

getSentences(int index)

public Sentence getSentences(int index)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence

getSentencesBuilder(int index)

public Sentence.Builder getSentencesBuilder(int index)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence.Builder

getSentencesBuilderList()

public List<Sentence.Builder> getSentencesBuilderList()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Returns
TypeDescription
List<Builder>

getSentencesCount()

public int getSentencesCount()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Returns
TypeDescription
int

getSentencesList()

public List<Sentence> getSentencesList()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Returns
TypeDescription
List<Sentence>

getSentencesOrBuilder(int index)

public SentenceOrBuilder getSentencesOrBuilder(int index)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
SentenceOrBuilder

getSentencesOrBuilderList()

public List<? extends SentenceOrBuilder> getSentencesOrBuilderList()

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

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

hasDocumentSentiment()

public boolean hasDocumentSentiment()

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

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 AnnotateTextResponse.Builder mergeDocumentSentiment(Sentiment value)

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
AnnotateTextResponse.Builder

mergeFrom(AnnotateTextResponse other)

public AnnotateTextResponse.Builder mergeFrom(AnnotateTextResponse other)
Parameter
NameDescription
otherAnnotateTextResponse
Returns
TypeDescription
AnnotateTextResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeCategories(int index)

public AnnotateTextResponse.Builder removeCategories(int index)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
AnnotateTextResponse.Builder

removeEntities(int index)

public AnnotateTextResponse.Builder removeEntities(int index)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
AnnotateTextResponse.Builder

removeModerationCategories(int index)

public AnnotateTextResponse.Builder removeModerationCategories(int index)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
AnnotateTextResponse.Builder

removeSentences(int index)

public AnnotateTextResponse.Builder removeSentences(int index)

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
AnnotateTextResponse.Builder

setCategories(int index, ClassificationCategory value)

public AnnotateTextResponse.Builder setCategories(int index, ClassificationCategory value)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameters
NameDescription
indexint
valueClassificationCategory
Returns
TypeDescription
AnnotateTextResponse.Builder

setCategories(int index, ClassificationCategory.Builder builderForValue)

public AnnotateTextResponse.Builder setCategories(int index, ClassificationCategory.Builder builderForValue)

Categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory categories = 5;

Parameters
NameDescription
indexint
builderForValueClassificationCategory.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

setDocumentSentiment(Sentiment value)

public AnnotateTextResponse.Builder setDocumentSentiment(Sentiment value)

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
AnnotateTextResponse.Builder

setDocumentSentiment(Sentiment.Builder builderForValue)

public AnnotateTextResponse.Builder setDocumentSentiment(Sentiment.Builder builderForValue)

The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

.google.cloud.language.v2.Sentiment document_sentiment = 3;

Parameter
NameDescription
builderForValueSentiment.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

setEntities(int index, Entity value)

public AnnotateTextResponse.Builder setEntities(int index, Entity value)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameters
NameDescription
indexint
valueEntity
Returns
TypeDescription
AnnotateTextResponse.Builder

setEntities(int index, Entity.Builder builderForValue)

public AnnotateTextResponse.Builder setEntities(int index, Entity.Builder builderForValue)

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.

repeated .google.cloud.language.v2.Entity entities = 2;

Parameters
NameDescription
indexint
builderForValueEntity.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setLanguageCode(String value)

public AnnotateTextResponse.Builder setLanguageCode(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_code = 4;

Parameter
NameDescription
valueString

The languageCode to set.

Returns
TypeDescription
AnnotateTextResponse.Builder

This builder for chaining.

setLanguageCodeBytes(ByteString value)

public AnnotateTextResponse.Builder setLanguageCodeBytes(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_code = 4;

Parameter
NameDescription
valueByteString

The bytes for languageCode to set.

Returns
TypeDescription
AnnotateTextResponse.Builder

This builder for chaining.

setLanguageSupported(boolean value)

public AnnotateTextResponse.Builder setLanguageSupported(boolean value)

Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.

bool language_supported = 7;

Parameter
NameDescription
valueboolean

The languageSupported to set.

Returns
TypeDescription
AnnotateTextResponse.Builder

This builder for chaining.

setModerationCategories(int index, ClassificationCategory value)

public AnnotateTextResponse.Builder setModerationCategories(int index, ClassificationCategory value)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameters
NameDescription
indexint
valueClassificationCategory
Returns
TypeDescription
AnnotateTextResponse.Builder

setModerationCategories(int index, ClassificationCategory.Builder builderForValue)

public AnnotateTextResponse.Builder setModerationCategories(int index, ClassificationCategory.Builder builderForValue)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 6;

Parameters
NameDescription
indexint
builderForValueClassificationCategory.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

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

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

setSentences(int index, Sentence value)

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

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameters
NameDescription
indexint
valueSentence
Returns
TypeDescription
AnnotateTextResponse.Builder

setSentences(int index, Sentence.Builder builderForValue)

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

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.

repeated .google.cloud.language.v2.Sentence sentences = 1;

Parameters
NameDescription
indexint
builderForValueSentence.Builder
Returns
TypeDescription
AnnotateTextResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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