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.v2.EntityMention
    • 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.v2.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.v2.TextSpan text = 1;
      • getTextBuilder

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

        public int getTypeValue()
         The type of the entity mention.
         
        .google.cloud.language.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.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.v2.Sentiment sentiment = 3;
      • mergeSentiment

        public EntityMention.Builder mergeSentiment​(Sentiment value)
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.v2.Sentiment sentiment = 3;
      • clearSentiment

        public EntityMention.Builder clearSentiment()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.v2.Sentiment sentiment = 3;
      • getSentimentBuilder

        public Sentiment.Builder getSentimentBuilder()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.v2.Sentiment sentiment = 3;
      • getSentimentOrBuilder

        public SentimentOrBuilder getSentimentOrBuilder()
         For calls to [AnalyzeEntitySentiment][] or if
         [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.v2.Sentiment sentiment = 3;
        Specified by:
        getSentimentOrBuilder in interface EntityMentionOrBuilder
      • getProbability

        public float getProbability()
         Probability score associated with the entity.
        
         The score shows the probability of the entity mention being the entity
         type. The score is in (0, 1] range.
         
        float probability = 4;
        Specified by:
        getProbability in interface EntityMentionOrBuilder
        Returns:
        The probability.
      • setProbability

        public EntityMention.Builder setProbability​(float value)
         Probability score associated with the entity.
        
         The score shows the probability of the entity mention being the entity
         type. The score is in (0, 1] range.
         
        float probability = 4;
        Parameters:
        value - The probability to set.
        Returns:
        This builder for chaining.
      • clearProbability

        public EntityMention.Builder clearProbability()
         Probability score associated with the entity.
        
         The score shows the probability of the entity mention being the entity
         type. The score is in (0, 1] range.
         
        float probability = 4;
        Returns:
        This builder for chaining.
      • 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>