Class Rule.Builder

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

    public static final class Rule.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Rule.Builder>
    implements RuleOrBuilder
     A rule is a condition-action pair
    
     * A condition defines when a rule is to be triggered.
     * An action specifies what occurs on that trigger.
     Currently rules only work for [controls][google.cloud.retail.v2beta.Control]
     with
     [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
     
    Protobuf type google.cloud.retail.v2beta.Rule
    • 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.Builder>
      • clear

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

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

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

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

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

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

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

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

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

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

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

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

        public boolean hasBoostAction()
         A boost action.
         
        .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;
        Specified by:
        hasBoostAction in interface RuleOrBuilder
        Returns:
        Whether the boostAction field is set.
      • getBoostAction

        public Rule.BoostAction getBoostAction()
         A boost action.
         
        .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;
        Specified by:
        getBoostAction in interface RuleOrBuilder
        Returns:
        The boostAction.
      • setBoostAction

        public Rule.Builder setBoostAction​(Rule.BoostAction value)
         A boost action.
         
        .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;
      • mergeBoostAction

        public Rule.Builder mergeBoostAction​(Rule.BoostAction value)
         A boost action.
         
        .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;
      • clearBoostAction

        public Rule.Builder clearBoostAction()
         A boost action.
         
        .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;
      • getBoostActionBuilder

        public Rule.BoostAction.Builder getBoostActionBuilder()
         A boost action.
         
        .google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;
      • hasRedirectAction

        public boolean hasRedirectAction()
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
        Specified by:
        hasRedirectAction in interface RuleOrBuilder
        Returns:
        Whether the redirectAction field is set.
      • getRedirectAction

        public Rule.RedirectAction getRedirectAction()
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
        Specified by:
        getRedirectAction in interface RuleOrBuilder
        Returns:
        The redirectAction.
      • setRedirectAction

        public Rule.Builder setRedirectAction​(Rule.RedirectAction value)
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
      • setRedirectAction

        public Rule.Builder setRedirectAction​(Rule.RedirectAction.Builder builderForValue)
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
      • mergeRedirectAction

        public Rule.Builder mergeRedirectAction​(Rule.RedirectAction value)
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
      • clearRedirectAction

        public Rule.Builder clearRedirectAction()
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
      • getRedirectActionBuilder

        public Rule.RedirectAction.Builder getRedirectActionBuilder()
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;
      • hasOnewaySynonymsAction

        public boolean hasOnewaySynonymsAction()
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
        Specified by:
        hasOnewaySynonymsAction in interface RuleOrBuilder
        Returns:
        Whether the onewaySynonymsAction field is set.
      • getOnewaySynonymsAction

        public Rule.OnewaySynonymsAction getOnewaySynonymsAction()
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
        Specified by:
        getOnewaySynonymsAction in interface RuleOrBuilder
        Returns:
        The onewaySynonymsAction.
      • setOnewaySynonymsAction

        public Rule.Builder setOnewaySynonymsAction​(Rule.OnewaySynonymsAction value)
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
      • setOnewaySynonymsAction

        public Rule.Builder setOnewaySynonymsAction​(Rule.OnewaySynonymsAction.Builder builderForValue)
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
      • mergeOnewaySynonymsAction

        public Rule.Builder mergeOnewaySynonymsAction​(Rule.OnewaySynonymsAction value)
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
      • clearOnewaySynonymsAction

        public Rule.Builder clearOnewaySynonymsAction()
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
      • getOnewaySynonymsActionBuilder

        public Rule.OnewaySynonymsAction.Builder getOnewaySynonymsActionBuilder()
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
      • getOnewaySynonymsActionOrBuilder

        public Rule.OnewaySynonymsActionOrBuilder getOnewaySynonymsActionOrBuilder()
         Treats specific term as a synonym with a group of terms.
         Group of terms will not be treated as synonyms with the specific term.
         
        .google.cloud.retail.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
        Specified by:
        getOnewaySynonymsActionOrBuilder in interface RuleOrBuilder
      • hasDoNotAssociateAction

        public boolean hasDoNotAssociateAction()
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
        Specified by:
        hasDoNotAssociateAction in interface RuleOrBuilder
        Returns:
        Whether the doNotAssociateAction field is set.
      • getDoNotAssociateAction

        public Rule.DoNotAssociateAction getDoNotAssociateAction()
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
        Specified by:
        getDoNotAssociateAction in interface RuleOrBuilder
        Returns:
        The doNotAssociateAction.
      • setDoNotAssociateAction

        public Rule.Builder setDoNotAssociateAction​(Rule.DoNotAssociateAction value)
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
      • setDoNotAssociateAction

        public Rule.Builder setDoNotAssociateAction​(Rule.DoNotAssociateAction.Builder builderForValue)
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
      • mergeDoNotAssociateAction

        public Rule.Builder mergeDoNotAssociateAction​(Rule.DoNotAssociateAction value)
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
      • clearDoNotAssociateAction

        public Rule.Builder clearDoNotAssociateAction()
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
      • getDoNotAssociateActionBuilder

        public Rule.DoNotAssociateAction.Builder getDoNotAssociateActionBuilder()
         Prevents term from being associated with other terms.
         
        .google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;
      • hasReplacementAction

        public boolean hasReplacementAction()
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
        Specified by:
        hasReplacementAction in interface RuleOrBuilder
        Returns:
        Whether the replacementAction field is set.
      • getReplacementAction

        public Rule.ReplacementAction getReplacementAction()
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
        Specified by:
        getReplacementAction in interface RuleOrBuilder
        Returns:
        The replacementAction.
      • setReplacementAction

        public Rule.Builder setReplacementAction​(Rule.ReplacementAction value)
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
      • setReplacementAction

        public Rule.Builder setReplacementAction​(Rule.ReplacementAction.Builder builderForValue)
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
      • mergeReplacementAction

        public Rule.Builder mergeReplacementAction​(Rule.ReplacementAction value)
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
      • clearReplacementAction

        public Rule.Builder clearReplacementAction()
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
      • getReplacementActionBuilder

        public Rule.ReplacementAction.Builder getReplacementActionBuilder()
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;
      • hasIgnoreAction

        public boolean hasIgnoreAction()
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
        Specified by:
        hasIgnoreAction in interface RuleOrBuilder
        Returns:
        Whether the ignoreAction field is set.
      • getIgnoreAction

        public Rule.IgnoreAction getIgnoreAction()
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
        Specified by:
        getIgnoreAction in interface RuleOrBuilder
        Returns:
        The ignoreAction.
      • setIgnoreAction

        public Rule.Builder setIgnoreAction​(Rule.IgnoreAction value)
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
      • setIgnoreAction

        public Rule.Builder setIgnoreAction​(Rule.IgnoreAction.Builder builderForValue)
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
      • mergeIgnoreAction

        public Rule.Builder mergeIgnoreAction​(Rule.IgnoreAction value)
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
      • clearIgnoreAction

        public Rule.Builder clearIgnoreAction()
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
      • getIgnoreActionBuilder

        public Rule.IgnoreAction.Builder getIgnoreActionBuilder()
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;
      • hasFilterAction

        public boolean hasFilterAction()
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
        Specified by:
        hasFilterAction in interface RuleOrBuilder
        Returns:
        Whether the filterAction field is set.
      • getFilterAction

        public Rule.FilterAction getFilterAction()
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
        Specified by:
        getFilterAction in interface RuleOrBuilder
        Returns:
        The filterAction.
      • setFilterAction

        public Rule.Builder setFilterAction​(Rule.FilterAction value)
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
      • setFilterAction

        public Rule.Builder setFilterAction​(Rule.FilterAction.Builder builderForValue)
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
      • mergeFilterAction

        public Rule.Builder mergeFilterAction​(Rule.FilterAction value)
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
      • clearFilterAction

        public Rule.Builder clearFilterAction()
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
      • getFilterActionBuilder

        public Rule.FilterAction.Builder getFilterActionBuilder()
         Filters results.
         
        .google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;
      • hasTwowaySynonymsAction

        public boolean hasTwowaySynonymsAction()
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
        Specified by:
        hasTwowaySynonymsAction in interface RuleOrBuilder
        Returns:
        Whether the twowaySynonymsAction field is set.
      • getTwowaySynonymsAction

        public Rule.TwowaySynonymsAction getTwowaySynonymsAction()
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
        Specified by:
        getTwowaySynonymsAction in interface RuleOrBuilder
        Returns:
        The twowaySynonymsAction.
      • setTwowaySynonymsAction

        public Rule.Builder setTwowaySynonymsAction​(Rule.TwowaySynonymsAction value)
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
      • setTwowaySynonymsAction

        public Rule.Builder setTwowaySynonymsAction​(Rule.TwowaySynonymsAction.Builder builderForValue)
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
      • mergeTwowaySynonymsAction

        public Rule.Builder mergeTwowaySynonymsAction​(Rule.TwowaySynonymsAction value)
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
      • clearTwowaySynonymsAction

        public Rule.Builder clearTwowaySynonymsAction()
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
      • getTwowaySynonymsActionBuilder

        public Rule.TwowaySynonymsAction.Builder getTwowaySynonymsActionBuilder()
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
      • hasCondition

        public boolean hasCondition()
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        hasCondition in interface RuleOrBuilder
        Returns:
        Whether the condition field is set.
      • getCondition

        public Condition getCondition()
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCondition in interface RuleOrBuilder
        Returns:
        The condition.
      • setCondition

        public Rule.Builder setCondition​(Condition value)
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
      • setCondition

        public Rule.Builder setCondition​(Condition.Builder builderForValue)
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
      • mergeCondition

        public Rule.Builder mergeCondition​(Condition value)
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
      • clearCondition

        public Rule.Builder clearCondition()
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
      • getConditionBuilder

        public Condition.Builder getConditionBuilder()
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
      • getConditionOrBuilder

        public ConditionOrBuilder getConditionOrBuilder()
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getConditionOrBuilder in interface RuleOrBuilder
      • setUnknownFields

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

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