Class Rule

  • All Implemented Interfaces:
    RuleOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class Rule
    extends com.google.protobuf.GeneratedMessageV3
    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.v2alpha.Control]
     with
     [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH].
     
    Protobuf type google.cloud.retail.v2alpha.Rule
    See Also:
    Serialized Form
    • Field Detail

      • BOOST_ACTION_FIELD_NUMBER

        public static final int BOOST_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REDIRECT_ACTION_FIELD_NUMBER

        public static final int REDIRECT_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER

        public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER

        public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REPLACEMENT_ACTION_FIELD_NUMBER

        public static final int REPLACEMENT_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • IGNORE_ACTION_FIELD_NUMBER

        public static final int IGNORE_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • FILTER_ACTION_FIELD_NUMBER

        public static final int FILTER_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER

        public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • 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
      • hasBoostAction

        public boolean hasBoostAction()
         A boost action.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Rule.BoostAction boost_action = 2;
        Specified by:
        getBoostAction in interface RuleOrBuilder
        Returns:
        The boostAction.
      • hasRedirectAction

        public boolean hasRedirectAction()
         Redirects a shopper to a specific page.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Rule.RedirectAction redirect_action = 3;
        Specified by:
        getRedirectAction in interface RuleOrBuilder
        Returns:
        The redirectAction.
      • 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.v2alpha.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.v2alpha.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;
        Specified by:
        getOnewaySynonymsAction in interface RuleOrBuilder
        Returns:
        The onewaySynonymsAction.
      • 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.v2alpha.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.v2alpha.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.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
        Specified by:
        getDoNotAssociateAction in interface RuleOrBuilder
        Returns:
        The doNotAssociateAction.
      • hasReplacementAction

        public boolean hasReplacementAction()
         Replaces specific terms in the query.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Rule.ReplacementAction replacement_action = 8;
        Specified by:
        getReplacementAction in interface RuleOrBuilder
        Returns:
        The replacementAction.
      • hasIgnoreAction

        public boolean hasIgnoreAction()
         Ignores specific terms from query during search.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Rule.IgnoreAction ignore_action = 9;
        Specified by:
        getIgnoreAction in interface RuleOrBuilder
        Returns:
        The ignoreAction.
      • hasFilterAction

        public boolean hasFilterAction()
         Filters results.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Rule.FilterAction filter_action = 10;
        Specified by:
        getFilterAction in interface RuleOrBuilder
        Returns:
        The filterAction.
      • hasTwowaySynonymsAction

        public boolean hasTwowaySynonymsAction()
         Treats a set of terms as synonyms of one another.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
        Specified by:
        getTwowaySynonymsAction in interface RuleOrBuilder
        Returns:
        The twowaySynonymsAction.
      • hasCondition

        public boolean hasCondition()
         Required. The condition that triggers the rule.
         If the condition is empty, the rule will always apply.
         
        .google.cloud.retail.v2alpha.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.v2alpha.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getCondition in interface RuleOrBuilder
        Returns:
        The condition.
      • getConditionOrBuilder

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

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Rule parseFrom​(ByteBuffer data)
                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rule parseFrom​(ByteBuffer data,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rule parseFrom​(com.google.protobuf.ByteString data)
                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rule parseFrom​(com.google.protobuf.ByteString data,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rule parseFrom​(byte[] data)
                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rule parseFrom​(byte[] data,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                              throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rule parseFrom​(com.google.protobuf.CodedInputStream input,
                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                              throws IOException
        Throws:
        IOException
      • newBuilderForType

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

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

        protected Rule.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static Rule getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<Rule> parser()
      • getParserForType

        public com.google.protobuf.Parser<Rule> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

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