Class Sentence.Builder

  • All Implemented Interfaces:
    SentenceOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    Sentence

    public static final class Sentence.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
    implements SentenceOrBuilder
     Represents a sentence in the input document.
     
    Protobuf type google.cloud.language.v1beta2.Sentence
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Sentence.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)  
      Sentence build()  
      Sentence buildPartial()  
      Sentence.Builder clear()  
      Sentence.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)  
      Sentence.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)  
      Sentence.Builder clearSentiment()
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      Sentence.Builder clearText()
      The sentence text.
      Sentence.Builder clone()  
      Sentence getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      Sentiment getSentiment()
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      Sentiment.Builder getSentimentBuilder()
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      SentimentOrBuilder getSentimentOrBuilder()
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      TextSpan getText()
      The sentence text.
      TextSpan.Builder getTextBuilder()
      The sentence text.
      TextSpanOrBuilder getTextOrBuilder()
      The sentence text.
      boolean hasSentiment()
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      boolean hasText()
      The sentence text.
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      Sentence.Builder mergeFrom​(Sentence other)  
      Sentence.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      Sentence.Builder mergeFrom​(com.google.protobuf.Message other)  
      Sentence.Builder mergeSentiment​(Sentiment value)
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      Sentence.Builder mergeText​(TextSpan value)
      The sentence text.
      Sentence.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)  
      Sentence.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)  
      Sentence.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)  
      Sentence.Builder setSentiment​(Sentiment value)
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      Sentence.Builder setSentiment​(Sentiment.Builder builderForValue)
      For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
      Sentence.Builder setText​(TextSpan value)
      The sentence text.
      Sentence.Builder setText​(TextSpan.Builder builderForValue)
      The sentence text.
      Sentence.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)  
      • Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder

        getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
      • Methods inherited from class com.google.protobuf.AbstractMessage.Builder

        findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

        addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
      • Methods inherited from interface com.google.protobuf.Message.Builder

        mergeDelimitedFrom, mergeDelimitedFrom
      • Methods inherited from interface com.google.protobuf.MessageLite.Builder

        mergeFrom
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • 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.Builder<Sentence.Builder>
      • clear

        public Sentence.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • getDefaultInstanceForType

        public Sentence getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public Sentence build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public Sentence buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public Sentence.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • setField

        public Sentence.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                         Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • clearField

        public Sentence.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • clearOneof

        public Sentence.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • setRepeatedField

        public Sentence.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 int index,
                                                 Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • addRepeatedField

        public Sentence.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • mergeFrom

        public Sentence.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Sentence.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • mergeFrom

        public Sentence.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Sentence.Builder>
        Throws:
        IOException
      • hasText

        public boolean hasText()
         The sentence text.
         
        .google.cloud.language.v1beta2.TextSpan text = 1;
        Specified by:
        hasText in interface SentenceOrBuilder
        Returns:
        Whether the text field is set.
      • getText

        public TextSpan getText()
         The sentence text.
         
        .google.cloud.language.v1beta2.TextSpan text = 1;
        Specified by:
        getText in interface SentenceOrBuilder
        Returns:
        The text.
      • setText

        public Sentence.Builder setText​(TextSpan value)
         The sentence text.
         
        .google.cloud.language.v1beta2.TextSpan text = 1;
      • mergeText

        public Sentence.Builder mergeText​(TextSpan value)
         The sentence text.
         
        .google.cloud.language.v1beta2.TextSpan text = 1;
      • clearText

        public Sentence.Builder clearText()
         The sentence text.
         
        .google.cloud.language.v1beta2.TextSpan text = 1;
      • getTextBuilder

        public TextSpan.Builder getTextBuilder()
         The sentence text.
         
        .google.cloud.language.v1beta2.TextSpan text = 1;
      • hasSentiment

        public boolean hasSentiment()
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
        Specified by:
        hasSentiment in interface SentenceOrBuilder
        Returns:
        Whether the sentiment field is set.
      • getSentiment

        public Sentiment getSentiment()
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
        Specified by:
        getSentiment in interface SentenceOrBuilder
        Returns:
        The sentiment.
      • setSentiment

        public Sentence.Builder setSentiment​(Sentiment value)
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
      • setSentiment

        public Sentence.Builder setSentiment​(Sentiment.Builder builderForValue)
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
      • mergeSentiment

        public Sentence.Builder mergeSentiment​(Sentiment value)
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
      • clearSentiment

        public Sentence.Builder clearSentiment()
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
      • getSentimentBuilder

        public Sentiment.Builder getSentimentBuilder()
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
      • getSentimentOrBuilder

        public SentimentOrBuilder getSentimentOrBuilder()
         For calls to [AnalyzeSentiment][] or if
         [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.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;
        Specified by:
        getSentimentOrBuilder in interface SentenceOrBuilder
      • setUnknownFields

        public final Sentence.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>
      • mergeUnknownFields

        public final Sentence.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Sentence.Builder>