Class AnnotateTextResponse

  • All Implemented Interfaces:
    AnnotateTextResponseOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class AnnotateTextResponse
    extends com.google.protobuf.GeneratedMessageV3
    implements AnnotateTextResponseOrBuilder
     The text annotations response message.
     
    Protobuf type google.cloud.language.v1beta2.AnnotateTextResponse
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getSentencesList

        public List<Sentence> getSentencesList()
         Sentences in the input document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Sentence sentences = 1;
        Specified by:
        getSentencesList in interface AnnotateTextResponseOrBuilder
      • getSentencesOrBuilderList

        public List<? extends SentenceOrBuilder> getSentencesOrBuilderList()
         Sentences in the input document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Sentence sentences = 1;
        Specified by:
        getSentencesOrBuilderList in interface AnnotateTextResponseOrBuilder
      • getSentencesCount

        public int getSentencesCount()
         Sentences in the input document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Sentence sentences = 1;
        Specified by:
        getSentencesCount in interface AnnotateTextResponseOrBuilder
      • getSentences

        public Sentence getSentences​(int index)
         Sentences in the input document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Sentence sentences = 1;
        Specified by:
        getSentences in interface AnnotateTextResponseOrBuilder
      • getSentencesOrBuilder

        public SentenceOrBuilder getSentencesOrBuilder​(int index)
         Sentences in the input document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Sentence sentences = 1;
        Specified by:
        getSentencesOrBuilder in interface AnnotateTextResponseOrBuilder
      • getTokensList

        public List<Token> getTokensList()
         Tokens, along with their syntactic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Token tokens = 2;
        Specified by:
        getTokensList in interface AnnotateTextResponseOrBuilder
      • 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][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Token tokens = 2;
        Specified by:
        getTokensOrBuilderList in interface AnnotateTextResponseOrBuilder
      • getTokensCount

        public int getTokensCount()
         Tokens, along with their syntactic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Token tokens = 2;
        Specified by:
        getTokensCount in interface AnnotateTextResponseOrBuilder
      • getTokens

        public Token getTokens​(int index)
         Tokens, along with their syntactic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Token tokens = 2;
        Specified by:
        getTokens in interface AnnotateTextResponseOrBuilder
      • getTokensOrBuilder

        public TokenOrBuilder getTokensOrBuilder​(int index)
         Tokens, along with their syntactic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
         
        repeated .google.cloud.language.v1beta2.Token tokens = 2;
        Specified by:
        getTokensOrBuilder in interface AnnotateTextResponseOrBuilder
      • getEntitiesList

        public List<Entity> getEntitiesList()
         Entities, along with their semantic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities].
         
        repeated .google.cloud.language.v1beta2.Entity entities = 3;
        Specified by:
        getEntitiesList in interface AnnotateTextResponseOrBuilder
      • 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][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities].
         
        repeated .google.cloud.language.v1beta2.Entity entities = 3;
        Specified by:
        getEntitiesOrBuilderList in interface AnnotateTextResponseOrBuilder
      • getEntitiesCount

        public int getEntitiesCount()
         Entities, along with their semantic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities].
         
        repeated .google.cloud.language.v1beta2.Entity entities = 3;
        Specified by:
        getEntitiesCount in interface AnnotateTextResponseOrBuilder
      • getEntities

        public Entity getEntities​(int index)
         Entities, along with their semantic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities].
         
        repeated .google.cloud.language.v1beta2.Entity entities = 3;
        Specified by:
        getEntities in interface AnnotateTextResponseOrBuilder
      • getEntitiesOrBuilder

        public EntityOrBuilder getEntitiesOrBuilder​(int index)
         Entities, along with their semantic information, in the input document.
         Populated if the user enables
         [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities].
         
        repeated .google.cloud.language.v1beta2.Entity entities = 3;
        Specified by:
        getEntitiesOrBuilder in interface AnnotateTextResponseOrBuilder
      • hasDocumentSentiment

        public boolean hasDocumentSentiment()
         The overall sentiment for the document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment].
         
        .google.cloud.language.v1beta2.Sentiment document_sentiment = 4;
        Specified by:
        hasDocumentSentiment in interface AnnotateTextResponseOrBuilder
        Returns:
        Whether the documentSentiment field is set.
      • getDocumentSentiment

        public Sentiment getDocumentSentiment()
         The overall sentiment for the document. Populated if the user enables
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment].
         
        .google.cloud.language.v1beta2.Sentiment document_sentiment = 4;
        Specified by:
        getDocumentSentiment in interface AnnotateTextResponseOrBuilder
        Returns:
        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.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment].
         
        .google.cloud.language.v1beta2.Sentiment document_sentiment = 4;
        Specified by:
        getDocumentSentimentOrBuilder in interface AnnotateTextResponseOrBuilder
      • 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][google.cloud.language.v1beta2.Document.language]
         field for more details.
         
        string language = 5;
        Specified by:
        getLanguage in interface AnnotateTextResponseOrBuilder
        Returns:
        The language.
      • getLanguageBytes

        public com.google.protobuf.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][google.cloud.language.v1beta2.Document.language]
         field for more details.
         
        string language = 5;
        Specified by:
        getLanguageBytes in interface AnnotateTextResponseOrBuilder
        Returns:
        The bytes for language.
      • getCategoriesCount

        public int getCategoriesCount()
         Categories identified in the input document.
         
        repeated .google.cloud.language.v1beta2.ClassificationCategory categories = 6;
        Specified by:
        getCategoriesCount in interface AnnotateTextResponseOrBuilder
      • getModerationCategoriesCount

        public int getModerationCategoriesCount()
         Harmful and sensitive categories identified in the input document.
         
        repeated .google.cloud.language.v1beta2.ClassificationCategory moderation_categories = 8;
        Specified by:
        getModerationCategoriesCount in interface AnnotateTextResponseOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static AnnotateTextResponse parseFrom​(ByteBuffer data)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AnnotateTextResponse parseFrom​(ByteBuffer data,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AnnotateTextResponse parseFrom​(com.google.protobuf.ByteString data)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AnnotateTextResponse parseFrom​(com.google.protobuf.ByteString data,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AnnotateTextResponse parseFrom​(byte[] data)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static AnnotateTextResponse parseFrom​(byte[] data,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • newBuilderForType

        public AnnotateTextResponse.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public AnnotateTextResponse.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected AnnotateTextResponse.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<AnnotateTextResponse> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public AnnotateTextResponse getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder