Class Rule.OnewaySynonymsAction.Builder

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

    public static final class Rule.OnewaySynonymsAction.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Rule.OnewaySynonymsAction.Builder>
    implements Rule.OnewaySynonymsActionOrBuilder
     Maps a set of terms to a set of synonyms.
     Set of synonyms will be treated as synonyms of each query term only.
     `query_terms` will not be treated as synonyms of each other.
     Example: "sneakers" will use a synonym of "shoes".
     "shoes" will not use a synonym of "sneakers".
     
    Protobuf type google.cloud.retail.v2.Rule.OnewaySynonymsAction
    • 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.OnewaySynonymsAction.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.OnewaySynonymsAction.Builder>
      • getDefaultInstanceForType

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

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

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

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

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

        public com.google.protobuf.ProtocolStringList getQueryTermsList()
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Specified by:
        getQueryTermsList in interface Rule.OnewaySynonymsActionOrBuilder
        Returns:
        A list containing the queryTerms.
      • getQueryTermsCount

        public int getQueryTermsCount()
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Specified by:
        getQueryTermsCount in interface Rule.OnewaySynonymsActionOrBuilder
        Returns:
        The count of queryTerms.
      • getQueryTerms

        public String getQueryTerms​(int index)
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Specified by:
        getQueryTerms in interface Rule.OnewaySynonymsActionOrBuilder
        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 treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Specified by:
        getQueryTermsBytes in interface Rule.OnewaySynonymsActionOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the queryTerms at the given index.
      • setQueryTerms

        public Rule.OnewaySynonymsAction.Builder setQueryTerms​(int index,
                                                               String value)
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Parameters:
        index - The index to set the value at.
        value - The queryTerms to set.
        Returns:
        This builder for chaining.
      • addQueryTerms

        public Rule.OnewaySynonymsAction.Builder addQueryTerms​(String value)
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Parameters:
        value - The queryTerms to add.
        Returns:
        This builder for chaining.
      • addAllQueryTerms

        public Rule.OnewaySynonymsAction.Builder addAllQueryTerms​(Iterable<String> values)
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Parameters:
        values - The queryTerms to add.
        Returns:
        This builder for chaining.
      • clearQueryTerms

        public Rule.OnewaySynonymsAction.Builder clearQueryTerms()
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Returns:
        This builder for chaining.
      • addQueryTermsBytes

        public Rule.OnewaySynonymsAction.Builder addQueryTermsBytes​(com.google.protobuf.ByteString value)
         Terms from the search query.
         Will treat synonyms as their synonyms.
         Not themselves synonyms of the synonyms.
         Can specify up to 100 terms.
         
        repeated string query_terms = 3;
        Parameters:
        value - The bytes of the queryTerms to add.
        Returns:
        This builder for chaining.
      • getSynonymsList

        public com.google.protobuf.ProtocolStringList getSynonymsList()
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Specified by:
        getSynonymsList in interface Rule.OnewaySynonymsActionOrBuilder
        Returns:
        A list containing the synonyms.
      • getSynonymsCount

        public int getSynonymsCount()
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Specified by:
        getSynonymsCount in interface Rule.OnewaySynonymsActionOrBuilder
        Returns:
        The count of synonyms.
      • getSynonyms

        public String getSynonyms​(int index)
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Specified by:
        getSynonyms in interface Rule.OnewaySynonymsActionOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The synonyms at the given index.
      • getSynonymsBytes

        public com.google.protobuf.ByteString getSynonymsBytes​(int index)
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Specified by:
        getSynonymsBytes in interface Rule.OnewaySynonymsActionOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the synonyms at the given index.
      • setSynonyms

        public Rule.OnewaySynonymsAction.Builder setSynonyms​(int index,
                                                             String value)
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Parameters:
        index - The index to set the value at.
        value - The synonyms to set.
        Returns:
        This builder for chaining.
      • addSynonyms

        public Rule.OnewaySynonymsAction.Builder addSynonyms​(String value)
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Parameters:
        value - The synonyms to add.
        Returns:
        This builder for chaining.
      • addAllSynonyms

        public Rule.OnewaySynonymsAction.Builder addAllSynonyms​(Iterable<String> values)
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Parameters:
        values - The synonyms to add.
        Returns:
        This builder for chaining.
      • clearSynonyms

        public Rule.OnewaySynonymsAction.Builder clearSynonyms()
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Returns:
        This builder for chaining.
      • addSynonymsBytes

        public Rule.OnewaySynonymsAction.Builder addSynonymsBytes​(com.google.protobuf.ByteString value)
         Defines a set of synonyms.
         Cannot contain duplicates.
         Can specify up to 100 synonyms.
         
        repeated string synonyms = 4;
        Parameters:
        value - The bytes of the synonyms to add.
        Returns:
        This builder for chaining.
      • getOnewayTermsList

        public com.google.protobuf.ProtocolStringList getOnewayTermsList()
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Specified by:
        getOnewayTermsList in interface Rule.OnewaySynonymsActionOrBuilder
        Returns:
        A list containing the onewayTerms.
      • getOnewayTerms

        public String getOnewayTerms​(int index)
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Specified by:
        getOnewayTerms in interface Rule.OnewaySynonymsActionOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The onewayTerms at the given index.
      • getOnewayTermsBytes

        public com.google.protobuf.ByteString getOnewayTermsBytes​(int index)
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Specified by:
        getOnewayTermsBytes in interface Rule.OnewaySynonymsActionOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the onewayTerms at the given index.
      • setOnewayTerms

        public Rule.OnewaySynonymsAction.Builder setOnewayTerms​(int index,
                                                                String value)
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Parameters:
        index - The index to set the value at.
        value - The onewayTerms to set.
        Returns:
        This builder for chaining.
      • addOnewayTerms

        public Rule.OnewaySynonymsAction.Builder addOnewayTerms​(String value)
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Parameters:
        value - The onewayTerms to add.
        Returns:
        This builder for chaining.
      • addAllOnewayTerms

        public Rule.OnewaySynonymsAction.Builder addAllOnewayTerms​(Iterable<String> values)
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Parameters:
        values - The onewayTerms to add.
        Returns:
        This builder for chaining.
      • clearOnewayTerms

        public Rule.OnewaySynonymsAction.Builder clearOnewayTerms()
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Returns:
        This builder for chaining.
      • addOnewayTermsBytes

        public Rule.OnewaySynonymsAction.Builder addOnewayTermsBytes​(com.google.protobuf.ByteString value)
         Will be [deprecated = true] post migration;
         
        repeated string oneway_terms = 2;
        Parameters:
        value - The bytes of the onewayTerms to add.
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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