Class Rule.BoostAction.Builder

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

    public static final class Rule.BoostAction.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Rule.BoostAction.Builder>
    implements Rule.BoostActionOrBuilder
     A boost action to apply to results matching condition specified above.
     
    Protobuf type google.cloud.retail.v2.Rule.BoostAction
    • 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.BoostAction.Builder>
      • clear

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

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

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

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

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

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

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

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

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

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

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

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

        public float getBoost()
         Strength of the condition boost, which must be in [-1, 1]. Negative
         boost means demotion. Default is 0.0.
        
         Setting to 1.0 gives the item a big promotion. However, it does not
         necessarily mean that the boosted item will be the top result at all
         times, nor that other items will be excluded. Results could still be
         shown even when none of them matches the condition. And results that
         are significantly more relevant to the search query can still trump
         your heavily favored but irrelevant items.
        
         Setting to -1.0 gives the item a big demotion. However, results that
         are deeply relevant might still be shown. The item will have an
         upstream battle to get a fairly high ranking, but it is not blocked out
         completely.
        
         Setting to 0.0 means no boost applied. The boosting condition is
         ignored.
         
        float boost = 1;
        Specified by:
        getBoost in interface Rule.BoostActionOrBuilder
        Returns:
        The boost.
      • setBoost

        public Rule.BoostAction.Builder setBoost​(float value)
         Strength of the condition boost, which must be in [-1, 1]. Negative
         boost means demotion. Default is 0.0.
        
         Setting to 1.0 gives the item a big promotion. However, it does not
         necessarily mean that the boosted item will be the top result at all
         times, nor that other items will be excluded. Results could still be
         shown even when none of them matches the condition. And results that
         are significantly more relevant to the search query can still trump
         your heavily favored but irrelevant items.
        
         Setting to -1.0 gives the item a big demotion. However, results that
         are deeply relevant might still be shown. The item will have an
         upstream battle to get a fairly high ranking, but it is not blocked out
         completely.
        
         Setting to 0.0 means no boost applied. The boosting condition is
         ignored.
         
        float boost = 1;
        Parameters:
        value - The boost to set.
        Returns:
        This builder for chaining.
      • clearBoost

        public Rule.BoostAction.Builder clearBoost()
         Strength of the condition boost, which must be in [-1, 1]. Negative
         boost means demotion. Default is 0.0.
        
         Setting to 1.0 gives the item a big promotion. However, it does not
         necessarily mean that the boosted item will be the top result at all
         times, nor that other items will be excluded. Results could still be
         shown even when none of them matches the condition. And results that
         are significantly more relevant to the search query can still trump
         your heavily favored but irrelevant items.
        
         Setting to -1.0 gives the item a big demotion. However, results that
         are deeply relevant might still be shown. The item will have an
         upstream battle to get a fairly high ranking, but it is not blocked out
         completely.
        
         Setting to 0.0 means no boost applied. The boosting condition is
         ignored.
         
        float boost = 1;
        Returns:
        This builder for chaining.
      • getProductsFilter

        public String getProductsFilter()
         The filter can have a max size of 5000 characters.
         An expression which specifies which products to apply an action to.
         The syntax and supported fields are the same as a filter expression. See
         [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
         detail syntax and limitations.
        
         Examples:
        
         * To boost products with product ID "product_1" or "product_2", and
         color
           "Red" or "Blue":<br>
           *(id: ANY("product_1", "product_2"))<br>*
           *AND<br>*
           *(colorFamilies: ANY("Red", "Blue"))<br>*
         
        string products_filter = 2;
        Specified by:
        getProductsFilter in interface Rule.BoostActionOrBuilder
        Returns:
        The productsFilter.
      • getProductsFilterBytes

        public com.google.protobuf.ByteString getProductsFilterBytes()
         The filter can have a max size of 5000 characters.
         An expression which specifies which products to apply an action to.
         The syntax and supported fields are the same as a filter expression. See
         [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
         detail syntax and limitations.
        
         Examples:
        
         * To boost products with product ID "product_1" or "product_2", and
         color
           "Red" or "Blue":<br>
           *(id: ANY("product_1", "product_2"))<br>*
           *AND<br>*
           *(colorFamilies: ANY("Red", "Blue"))<br>*
         
        string products_filter = 2;
        Specified by:
        getProductsFilterBytes in interface Rule.BoostActionOrBuilder
        Returns:
        The bytes for productsFilter.
      • setProductsFilter

        public Rule.BoostAction.Builder setProductsFilter​(String value)
         The filter can have a max size of 5000 characters.
         An expression which specifies which products to apply an action to.
         The syntax and supported fields are the same as a filter expression. See
         [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
         detail syntax and limitations.
        
         Examples:
        
         * To boost products with product ID "product_1" or "product_2", and
         color
           "Red" or "Blue":<br>
           *(id: ANY("product_1", "product_2"))<br>*
           *AND<br>*
           *(colorFamilies: ANY("Red", "Blue"))<br>*
         
        string products_filter = 2;
        Parameters:
        value - The productsFilter to set.
        Returns:
        This builder for chaining.
      • clearProductsFilter

        public Rule.BoostAction.Builder clearProductsFilter()
         The filter can have a max size of 5000 characters.
         An expression which specifies which products to apply an action to.
         The syntax and supported fields are the same as a filter expression. See
         [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
         detail syntax and limitations.
        
         Examples:
        
         * To boost products with product ID "product_1" or "product_2", and
         color
           "Red" or "Blue":<br>
           *(id: ANY("product_1", "product_2"))<br>*
           *AND<br>*
           *(colorFamilies: ANY("Red", "Blue"))<br>*
         
        string products_filter = 2;
        Returns:
        This builder for chaining.
      • setProductsFilterBytes

        public Rule.BoostAction.Builder setProductsFilterBytes​(com.google.protobuf.ByteString value)
         The filter can have a max size of 5000 characters.
         An expression which specifies which products to apply an action to.
         The syntax and supported fields are the same as a filter expression. See
         [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for
         detail syntax and limitations.
        
         Examples:
        
         * To boost products with product ID "product_1" or "product_2", and
         color
           "Red" or "Blue":<br>
           *(id: ANY("product_1", "product_2"))<br>*
           *AND<br>*
           *(colorFamilies: ANY("Red", "Blue"))<br>*
         
        string products_filter = 2;
        Parameters:
        value - The bytes for productsFilter to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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