Class Rule.ReplacementAction.Builder

  • All Implemented Interfaces:
    Rule.ReplacementActionOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    Rule.ReplacementAction

    public static final class Rule.ReplacementAction.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Rule.ReplacementAction.Builder>
    implements Rule.ReplacementActionOrBuilder
     Replaces a term in the query. Multiple replacement candidates can be
     specified. All `query_terms` will be replaced with the replacement term.
     Example: Replace "gShoe" with "google shoe".
     
    Protobuf type google.cloud.retail.v2.Rule.ReplacementAction
    • 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<Rule.ReplacementAction.Builder>
      • clear

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

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

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

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

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

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

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

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

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

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

        public Rule.ReplacementAction.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<Rule.ReplacementAction.Builder>
        Throws:
        IOException
      • getQueryTermsList

        public com.google.protobuf.ProtocolStringList getQueryTermsList()
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Specified by:
        getQueryTermsList in interface Rule.ReplacementActionOrBuilder
        Returns:
        A list containing the queryTerms.
      • getQueryTermsCount

        public int getQueryTermsCount()
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Specified by:
        getQueryTermsCount in interface Rule.ReplacementActionOrBuilder
        Returns:
        The count of queryTerms.
      • getQueryTerms

        public String getQueryTerms​(int index)
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Specified by:
        getQueryTerms in interface Rule.ReplacementActionOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The queryTerms at the given index.
      • getQueryTermsBytes

        public com.google.protobuf.ByteString getQueryTermsBytes​(int index)
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Specified by:
        getQueryTermsBytes in interface Rule.ReplacementActionOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the queryTerms at the given index.
      • setQueryTerms

        public Rule.ReplacementAction.Builder setQueryTerms​(int index,
                                                            String value)
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Parameters:
        index - The index to set the value at.
        value - The queryTerms to set.
        Returns:
        This builder for chaining.
      • addQueryTerms

        public Rule.ReplacementAction.Builder addQueryTerms​(String value)
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Parameters:
        value - The queryTerms to add.
        Returns:
        This builder for chaining.
      • addAllQueryTerms

        public Rule.ReplacementAction.Builder addAllQueryTerms​(Iterable<String> values)
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Parameters:
        values - The queryTerms to add.
        Returns:
        This builder for chaining.
      • clearQueryTerms

        public Rule.ReplacementAction.Builder clearQueryTerms()
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Returns:
        This builder for chaining.
      • addQueryTermsBytes

        public Rule.ReplacementAction.Builder addQueryTermsBytes​(com.google.protobuf.ByteString value)
         Terms from the search query.
         Will be replaced by replacement term.
         Can specify up to 100 terms.
         
        repeated string query_terms = 2;
        Parameters:
        value - The bytes of the queryTerms to add.
        Returns:
        This builder for chaining.
      • getReplacementTermBytes

        public com.google.protobuf.ByteString getReplacementTermBytes()
         Term that will be used for replacement.
         
        string replacement_term = 3;
        Specified by:
        getReplacementTermBytes in interface Rule.ReplacementActionOrBuilder
        Returns:
        The bytes for replacementTerm.
      • setReplacementTerm

        public Rule.ReplacementAction.Builder setReplacementTerm​(String value)
         Term that will be used for replacement.
         
        string replacement_term = 3;
        Parameters:
        value - The replacementTerm to set.
        Returns:
        This builder for chaining.
      • clearReplacementTerm

        public Rule.ReplacementAction.Builder clearReplacementTerm()
         Term that will be used for replacement.
         
        string replacement_term = 3;
        Returns:
        This builder for chaining.
      • setReplacementTermBytes

        public Rule.ReplacementAction.Builder setReplacementTermBytes​(com.google.protobuf.ByteString value)
         Term that will be used for replacement.
         
        string replacement_term = 3;
        Parameters:
        value - The bytes for replacementTerm to set.
        Returns:
        This builder for chaining.
      • getTermBytes

        public com.google.protobuf.ByteString getTermBytes()
         Will be [deprecated = true] post migration;
         
        string term = 1;
        Specified by:
        getTermBytes in interface Rule.ReplacementActionOrBuilder
        Returns:
        The bytes for term.
      • setTerm

        public Rule.ReplacementAction.Builder setTerm​(String value)
         Will be [deprecated = true] post migration;
         
        string term = 1;
        Parameters:
        value - The term to set.
        Returns:
        This builder for chaining.
      • clearTerm

        public Rule.ReplacementAction.Builder clearTerm()
         Will be [deprecated = true] post migration;
         
        string term = 1;
        Returns:
        This builder for chaining.
      • setTermBytes

        public Rule.ReplacementAction.Builder setTermBytes​(com.google.protobuf.ByteString value)
         Will be [deprecated = true] post migration;
         
        string term = 1;
        Parameters:
        value - The bytes for term to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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