Class Rule.ReplacementAction.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Rule.ReplacementAction.Builder>
com.google.cloud.retail.v2alpha.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.GeneratedMessage.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.v2alpha.Rule.ReplacementAction
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<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.GeneratedMessage.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.GeneratedMessage.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
    • mergeFrom

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

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.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.
    • getReplacementTerm

      public String getReplacementTerm()
       Term that will be used for replacement.
       
      string replacement_term = 3;
      Specified by:
      getReplacementTerm in interface Rule.ReplacementActionOrBuilder
      Returns:
      The replacementTerm.
    • 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.
    • getTerm

      public String getTerm()
       Will be [deprecated = true] post migration;
       
      string term = 1;
      Specified by:
      getTerm in interface Rule.ReplacementActionOrBuilder
      Returns:
      The term.
    • 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.