Class AnnotateTextResponse (2.21.0)

public final class AnnotateTextResponse extends GeneratedMessageV3 implements AnnotateTextResponseOrBuilder

The text annotations response message.

Protobuf type google.cloud.language.v1.AnnotateTextResponse

Static Fields

CATEGORIES_FIELD_NUMBER

public static final int CATEGORIES_FIELD_NUMBER
Field Value
TypeDescription
int

DOCUMENT_SENTIMENT_FIELD_NUMBER

public static final int DOCUMENT_SENTIMENT_FIELD_NUMBER
Field Value
TypeDescription
int

ENTITIES_FIELD_NUMBER

public static final int ENTITIES_FIELD_NUMBER
Field Value
TypeDescription
int

LANGUAGE_FIELD_NUMBER

public static final int LANGUAGE_FIELD_NUMBER
Field Value
TypeDescription
int

MODERATION_CATEGORIES_FIELD_NUMBER

public static final int MODERATION_CATEGORIES_FIELD_NUMBER
Field Value
TypeDescription
int

SENTENCES_FIELD_NUMBER

public static final int SENTENCES_FIELD_NUMBER
Field Value
TypeDescription
int

TOKENS_FIELD_NUMBER

public static final int TOKENS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static AnnotateTextResponse getDefaultInstance()
Returns
TypeDescription
AnnotateTextResponse

getDescriptor()

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

newBuilder()

public static AnnotateTextResponse.Builder newBuilder()
Returns
TypeDescription
AnnotateTextResponse.Builder

newBuilder(AnnotateTextResponse prototype)

public static AnnotateTextResponse.Builder newBuilder(AnnotateTextResponse prototype)
Parameter
NameDescription
prototypeAnnotateTextResponse
Returns
TypeDescription
AnnotateTextResponse.Builder

parseDelimitedFrom(InputStream input)

public static AnnotateTextResponse parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AnnotateTextResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static AnnotateTextResponse parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static AnnotateTextResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static AnnotateTextResponse parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static AnnotateTextResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static AnnotateTextResponse parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static AnnotateTextResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static AnnotateTextResponse parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AnnotateTextResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static AnnotateTextResponse parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static AnnotateTextResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AnnotateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<AnnotateTextResponse> parser()
Returns
TypeDescription
Parser<AnnotateTextResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCategories(int index)

public ClassificationCategory getCategories(int index)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory

getCategoriesCount()

public int getCategoriesCount()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
TypeDescription
int

getCategoriesList()

public List<ClassificationCategory> getCategoriesList()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Returns
TypeDescription
List<ClassificationCategory>

getCategoriesOrBuilder(int index)

public ClassificationCategoryOrBuilder getCategoriesOrBuilder(int index)

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategoryOrBuilder

getCategoriesOrBuilderList()

public List<? extends ClassificationCategoryOrBuilder> getCategoriesOrBuilderList()

Categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory categories = 6;

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

getDefaultInstanceForType()

public AnnotateTextResponse getDefaultInstanceForType()
Returns
TypeDescription
AnnotateTextResponse

getDocumentSentiment()

public Sentiment getDocumentSentiment()

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

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
TypeDescription
Sentiment

The documentSentiment.

getDocumentSentimentOrBuilder()

public SentimentOrBuilder getDocumentSentimentOrBuilder()

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

.google.cloud.language.v1.Sentiment document_sentiment = 4;

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.

repeated .google.cloud.language.v1.Entity entities = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Entity

getEntitiesCount()

public int getEntitiesCount()

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

repeated .google.cloud.language.v1.Entity entities = 3;

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.

repeated .google.cloud.language.v1.Entity entities = 3;

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.

repeated .google.cloud.language.v1.Entity entities = 3;

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.

repeated .google.cloud.language.v1.Entity entities = 3;

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

getLanguage()

public String getLanguage()

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 = 5;

Returns
TypeDescription
String

The language.

getLanguageBytes()

public ByteString getLanguageBytes()

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 = 5;

Returns
TypeDescription
ByteString

The bytes for language.

getModerationCategories(int index)

public ClassificationCategory getModerationCategories(int index)

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory moderation_categories = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory

getModerationCategoriesCount()

public int getModerationCategoriesCount()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory moderation_categories = 7;

Returns
TypeDescription
int

getModerationCategoriesList()

public List<ClassificationCategory> getModerationCategoriesList()

Harmful and sensitive categories identified in the input document.

repeated .google.cloud.language.v1.ClassificationCategory moderation_categories = 7;

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.v1.ClassificationCategory moderation_categories = 7;

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.v1.ClassificationCategory moderation_categories = 7;

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

getParserForType()

public Parser<AnnotateTextResponse> getParserForType()
Returns
TypeDescription
Parser<AnnotateTextResponse>
Overrides

getSentences(int index)

public Sentence getSentences(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Sentence

getSentencesCount()

public int getSentencesCount()

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

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

Returns
TypeDescription
int

getSentencesList()

public List<Sentence> getSentencesList()

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

repeated .google.cloud.language.v1.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_syntax.

repeated .google.cloud.language.v1.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_syntax.

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

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

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getTokens(int index)

public Token getTokens(int index)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Token

getTokensCount()

public int getTokensCount()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
TypeDescription
int

getTokensList()

public List<Token> getTokensList()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
TypeDescription
List<Token>

getTokensOrBuilder(int index)

public TokenOrBuilder getTokensOrBuilder(int index)

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
TokenOrBuilder

getTokensOrBuilderList()

public List<? extends TokenOrBuilder> getTokensOrBuilderList()

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.

repeated .google.cloud.language.v1.Token tokens = 2;

Returns
TypeDescription
List<? extends com.google.cloud.language.v1.TokenOrBuilder>

hasDocumentSentiment()

public boolean hasDocumentSentiment()

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

.google.cloud.language.v1.Sentiment document_sentiment = 4;

Returns
TypeDescription
boolean

Whether the documentSentiment field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public AnnotateTextResponse.Builder newBuilderForType()
Returns
TypeDescription
AnnotateTextResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected AnnotateTextResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
AnnotateTextResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public AnnotateTextResponse.Builder toBuilder()
Returns
TypeDescription
AnnotateTextResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException