Class EntityMention.Builder

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

    public static final class EntityMention.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<EntityMention.Builder>
    implements EntityMentionOrBuilder
     Represents a mention for an entity in the text. Currently, proper noun
     mentions are supported.
     
    Protobuf type google.cloud.language.v1beta2.EntityMention
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      EntityMention.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)  
      EntityMention build()  
      EntityMention buildPartial()  
      EntityMention.Builder clear()  
      EntityMention.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)  
      EntityMention.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)  
      EntityMention.Builder clearSentiment()
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      EntityMention.Builder clearText()
      The mention text.
      EntityMention.Builder clearType()
      The type of the entity mention.
      EntityMention.Builder clone()  
      EntityMention getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      Sentiment getSentiment()
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      Sentiment.Builder getSentimentBuilder()
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      SentimentOrBuilder getSentimentOrBuilder()
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      TextSpan getText()
      The mention text.
      TextSpan.Builder getTextBuilder()
      The mention text.
      TextSpanOrBuilder getTextOrBuilder()
      The mention text.
      EntityMention.Type getType()
      The type of the entity mention.
      int getTypeValue()
      The type of the entity mention.
      boolean hasSentiment()
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      boolean hasText()
      The mention text.
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      EntityMention.Builder mergeFrom​(EntityMention other)  
      EntityMention.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      EntityMention.Builder mergeFrom​(com.google.protobuf.Message other)  
      EntityMention.Builder mergeSentiment​(Sentiment value)
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      EntityMention.Builder mergeText​(TextSpan value)
      The mention text.
      EntityMention.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)  
      EntityMention.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)  
      EntityMention.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)  
      EntityMention.Builder setSentiment​(Sentiment value)
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      EntityMention.Builder setSentiment​(Sentiment.Builder builderForValue)
      For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
      EntityMention.Builder setText​(TextSpan value)
      The mention text.
      EntityMention.Builder setText​(TextSpan.Builder builderForValue)
      The mention text.
      EntityMention.Builder setType​(EntityMention.Type value)
      The type of the entity mention.
      EntityMention.Builder setTypeValue​(int value)
      The type of the entity mention.
      EntityMention.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<EntityMention.Builder>
      • clear

        public EntityMention.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<EntityMention.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<EntityMention.Builder>
      • getDefaultInstanceForType

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

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

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

        public EntityMention.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<EntityMention.Builder>
      • setField

        public EntityMention.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<EntityMention.Builder>
      • clearField

        public EntityMention.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<EntityMention.Builder>
      • clearOneof

        public EntityMention.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<EntityMention.Builder>
      • setRepeatedField

        public EntityMention.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<EntityMention.Builder>
      • addRepeatedField

        public EntityMention.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<EntityMention.Builder>
      • mergeFrom

        public EntityMention.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<EntityMention.Builder>
      • isInitialized

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

        public EntityMention.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<EntityMention.Builder>
        Throws:
        IOException
      • hasText

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

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

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

        public int getTypeValue()
         The type of the entity mention.
         
        .google.cloud.language.v1beta2.EntityMention.Type type = 2;
        Specified by:
        getTypeValue in interface EntityMentionOrBuilder
        Returns:
        The enum numeric value on the wire for type.
      • setTypeValue

        public EntityMention.Builder setTypeValue​(int value)
         The type of the entity mention.
         
        .google.cloud.language.v1beta2.EntityMention.Type type = 2;
        Parameters:
        value - The enum numeric value on the wire for type to set.
        Returns:
        This builder for chaining.
      • setType

        public EntityMention.Builder setType​(EntityMention.Type value)
         The type of the entity mention.
         
        .google.cloud.language.v1beta2.EntityMention.Type type = 2;
        Parameters:
        value - The type to set.
        Returns:
        This builder for chaining.
      • clearType

        public EntityMention.Builder clearType()
         The type of the entity mention.
         
        .google.cloud.language.v1beta2.EntityMention.Type type = 2;
        Returns:
        This builder for chaining.
      • hasSentiment

        public boolean hasSentiment()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
        Specified by:
        hasSentiment in interface EntityMentionOrBuilder
        Returns:
        Whether the sentiment field is set.
      • getSentiment

        public Sentiment getSentiment()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
        Specified by:
        getSentiment in interface EntityMentionOrBuilder
        Returns:
        The sentiment.
      • setSentiment

        public EntityMention.Builder setSentiment​(Sentiment value)
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
      • setSentiment

        public EntityMention.Builder setSentiment​(Sentiment.Builder builderForValue)
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
      • mergeSentiment

        public EntityMention.Builder mergeSentiment​(Sentiment value)
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
      • clearSentiment

        public EntityMention.Builder clearSentiment()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
      • getSentimentBuilder

        public Sentiment.Builder getSentimentBuilder()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
      • getSentimentOrBuilder

        public SentimentOrBuilder getSentimentOrBuilder()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment]
         is set to true, this field will contain the sentiment expressed for this
         mention of the entity in the provided document.
         
        .google.cloud.language.v1beta2.Sentiment sentiment = 3;
        Specified by:
        getSentimentOrBuilder in interface EntityMentionOrBuilder
      • setUnknownFields

        public final EntityMention.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<EntityMention.Builder>
      • mergeUnknownFields

        public final EntityMention.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<EntityMention.Builder>