Class Rule

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.retail.v2alpha.Rule
All Implemented Interfaces:
RuleOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Rule extends com.google.protobuf.GeneratedMessage 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:
  • Field Details

    • BOOST_ACTION_FIELD_NUMBER

      public static final int BOOST_ACTION_FIELD_NUMBER
      See Also:
    • REDIRECT_ACTION_FIELD_NUMBER

      public static final int REDIRECT_ACTION_FIELD_NUMBER
      See Also:
    • ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER

      public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
      See Also:
    • DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER

      public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
      See Also:
    • REPLACEMENT_ACTION_FIELD_NUMBER

      public static final int REPLACEMENT_ACTION_FIELD_NUMBER
      See Also:
    • IGNORE_ACTION_FIELD_NUMBER

      public static final int IGNORE_ACTION_FIELD_NUMBER
      See Also:
    • FILTER_ACTION_FIELD_NUMBER

      public static final int FILTER_ACTION_FIELD_NUMBER
      See Also:
    • TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER

      public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
      See Also:
    • FORCE_RETURN_FACET_ACTION_FIELD_NUMBER

      public static final int FORCE_RETURN_FACET_ACTION_FIELD_NUMBER
      See Also:
    • REMOVE_FACET_ACTION_FIELD_NUMBER

      public static final int REMOVE_FACET_ACTION_FIELD_NUMBER
      See Also:
    • PIN_ACTION_FIELD_NUMBER

      public static final int PIN_ACTION_FIELD_NUMBER
      See Also:
    • CONDITION_FIELD_NUMBER

      public static final int CONDITION_FIELD_NUMBER
      See Also:
  • 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
    • getActionCase

      public Rule.ActionCase getActionCase()
      Specified by:
      getActionCase in interface RuleOrBuilder
    • 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.
    • getBoostActionOrBuilder

      public Rule.BoostActionOrBuilder getBoostActionOrBuilder()
       A boost action.
       
      .google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2;
      Specified by:
      getBoostActionOrBuilder in interface RuleOrBuilder
    • 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.
    • getRedirectActionOrBuilder

      public Rule.RedirectActionOrBuilder getRedirectActionOrBuilder()
       Redirects a shopper to a specific page.
       
      .google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3;
      Specified by:
      getRedirectActionOrBuilder in interface RuleOrBuilder
    • 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.
    • getDoNotAssociateActionOrBuilder

      public Rule.DoNotAssociateActionOrBuilder getDoNotAssociateActionOrBuilder()
       Prevents term from being associated with other terms.
       
      .google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
      Specified by:
      getDoNotAssociateActionOrBuilder in interface RuleOrBuilder
    • 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.
    • getReplacementActionOrBuilder

      public Rule.ReplacementActionOrBuilder getReplacementActionOrBuilder()
       Replaces specific terms in the query.
       
      .google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8;
      Specified by:
      getReplacementActionOrBuilder in interface RuleOrBuilder
    • 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.
    • getIgnoreActionOrBuilder

      public Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder()
       Ignores specific terms from query during search.
       
      .google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9;
      Specified by:
      getIgnoreActionOrBuilder in interface RuleOrBuilder
    • 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.
    • getFilterActionOrBuilder

      public Rule.FilterActionOrBuilder getFilterActionOrBuilder()
       Filters results.
       
      .google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10;
      Specified by:
      getFilterActionOrBuilder in interface RuleOrBuilder
    • 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.
    • getTwowaySynonymsActionOrBuilder

      public Rule.TwowaySynonymsActionOrBuilder getTwowaySynonymsActionOrBuilder()
       Treats a set of terms as synonyms of one another.
       
      .google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
      Specified by:
      getTwowaySynonymsActionOrBuilder in interface RuleOrBuilder
    • hasForceReturnFacetAction

      public boolean hasForceReturnFacetAction()
       Force returns an attribute as a facet in the request.
       
      .google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction force_return_facet_action = 12;
      Specified by:
      hasForceReturnFacetAction in interface RuleOrBuilder
      Returns:
      Whether the forceReturnFacetAction field is set.
    • getForceReturnFacetAction

      public Rule.ForceReturnFacetAction getForceReturnFacetAction()
       Force returns an attribute as a facet in the request.
       
      .google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction force_return_facet_action = 12;
      Specified by:
      getForceReturnFacetAction in interface RuleOrBuilder
      Returns:
      The forceReturnFacetAction.
    • getForceReturnFacetActionOrBuilder

      public Rule.ForceReturnFacetActionOrBuilder getForceReturnFacetActionOrBuilder()
       Force returns an attribute as a facet in the request.
       
      .google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction force_return_facet_action = 12;
      Specified by:
      getForceReturnFacetActionOrBuilder in interface RuleOrBuilder
    • hasRemoveFacetAction

      public boolean hasRemoveFacetAction()
       Remove an attribute as a facet in the request (if present).
       
      .google.cloud.retail.v2alpha.Rule.RemoveFacetAction remove_facet_action = 13;
      Specified by:
      hasRemoveFacetAction in interface RuleOrBuilder
      Returns:
      Whether the removeFacetAction field is set.
    • getRemoveFacetAction

      public Rule.RemoveFacetAction getRemoveFacetAction()
       Remove an attribute as a facet in the request (if present).
       
      .google.cloud.retail.v2alpha.Rule.RemoveFacetAction remove_facet_action = 13;
      Specified by:
      getRemoveFacetAction in interface RuleOrBuilder
      Returns:
      The removeFacetAction.
    • getRemoveFacetActionOrBuilder

      public Rule.RemoveFacetActionOrBuilder getRemoveFacetActionOrBuilder()
       Remove an attribute as a facet in the request (if present).
       
      .google.cloud.retail.v2alpha.Rule.RemoveFacetAction remove_facet_action = 13;
      Specified by:
      getRemoveFacetActionOrBuilder in interface RuleOrBuilder
    • hasPinAction

      public boolean hasPinAction()
       Pins one or more specified products to a specific position in the
       results.
       
      .google.cloud.retail.v2alpha.Rule.PinAction pin_action = 14;
      Specified by:
      hasPinAction in interface RuleOrBuilder
      Returns:
      Whether the pinAction field is set.
    • getPinAction

      public Rule.PinAction getPinAction()
       Pins one or more specified products to a specific position in the
       results.
       
      .google.cloud.retail.v2alpha.Rule.PinAction pin_action = 14;
      Specified by:
      getPinAction in interface RuleOrBuilder
      Returns:
      The pinAction.
    • getPinActionOrBuilder

      public Rule.PinActionOrBuilder getPinActionOrBuilder()
       Pins one or more specified products to a specific position in the
       results.
       
      .google.cloud.retail.v2alpha.Rule.PinAction pin_action = 14;
      Specified by:
      getPinActionOrBuilder in interface RuleOrBuilder
    • 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.GeneratedMessage
    • 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.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • 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(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Rule parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Rule parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Rule parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Rule parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • 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
    • newBuilder

      public static Rule.Builder newBuilder()
    • newBuilder

      public static Rule.Builder newBuilder(Rule prototype)
    • 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.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • 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.GeneratedMessage
    • getDefaultInstanceForType

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