public final class Rule extends 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 only boost rules are supported.
Currently only supported by the search endpoint.
Protobuf type google.cloud.retail.v2alpha.Rule
Static Fields
BOOST_ACTION_FIELD_NUMBER
public static final int BOOST_ACTION_FIELD_NUMBER
Field Value
CONDITION_FIELD_NUMBER
public static final int CONDITION_FIELD_NUMBER
Field Value
DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
Field Value
FILTER_ACTION_FIELD_NUMBER
public static final int FILTER_ACTION_FIELD_NUMBER
Field Value
IGNORE_ACTION_FIELD_NUMBER
public static final int IGNORE_ACTION_FIELD_NUMBER
Field Value
ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
Field Value
REDIRECT_ACTION_FIELD_NUMBER
public static final int REDIRECT_ACTION_FIELD_NUMBER
Field Value
REPLACEMENT_ACTION_FIELD_NUMBER
public static final int REPLACEMENT_ACTION_FIELD_NUMBER
Field Value
TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Rule getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Rule.Builder newBuilder()
Returns
newBuilder(Rule prototype)
public static Rule.Builder newBuilder(Rule prototype)
Parameter
Name | Description |
prototype | Rule
|
Returns
public static Rule parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Rule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Rule parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Rule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Rule parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Rule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Rule parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Rule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Rule parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Rule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Rule parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Rule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Rule> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getActionCase()
public Rule.ActionCase getActionCase()
Returns
getBoostAction()
public Rule.BoostAction getBoostAction()
A boost action.
.google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2;
Returns
getBoostActionOrBuilder()
public Rule.BoostActionOrBuilder getBoostActionOrBuilder()
A boost action.
.google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2;
Returns
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];
Returns
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];
Returns
getDefaultInstanceForType()
public Rule getDefaultInstanceForType()
Returns
getDoNotAssociateAction()
public Rule.DoNotAssociateAction getDoNotAssociateAction()
Prevents term from being associated with other terms.
.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
Returns
getDoNotAssociateActionOrBuilder()
public Rule.DoNotAssociateActionOrBuilder getDoNotAssociateActionOrBuilder()
Prevents term from being associated with other terms.
.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
Returns
getFilterAction()
public Rule.FilterAction getFilterAction()
Filters results.
.google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10;
Returns
getFilterActionOrBuilder()
public Rule.FilterActionOrBuilder getFilterActionOrBuilder()
Filters results.
.google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10;
Returns
getIgnoreAction()
public Rule.IgnoreAction getIgnoreAction()
Ignores specific terms from query during search.
.google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9;
Returns
getIgnoreActionOrBuilder()
public Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder()
Ignores specific terms from query during search.
.google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9;
Returns
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;
Returns
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;
Returns
getParserForType()
public Parser<Rule> getParserForType()
Returns
Overrides
getRedirectAction()
public Rule.RedirectAction getRedirectAction()
Redirects a shopper to a specific page.
.google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3;
Returns
getRedirectActionOrBuilder()
public Rule.RedirectActionOrBuilder getRedirectActionOrBuilder()
Redirects a shopper to a specific page.
.google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3;
Returns
getReplacementAction()
public Rule.ReplacementAction getReplacementAction()
Replaces specific terms in the query.
.google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8;
Returns
getReplacementActionOrBuilder()
public Rule.ReplacementActionOrBuilder getReplacementActionOrBuilder()
Replaces specific terms in the query.
.google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8;
Returns
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
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;
Returns
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;
Returns
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hasBoostAction()
public boolean hasBoostAction()
A boost action.
.google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2;
Returns
Type | Description |
boolean | Whether the boostAction field is set.
|
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];
Returns
Type | Description |
boolean | Whether the condition field is set.
|
hasDoNotAssociateAction()
public boolean hasDoNotAssociateAction()
Prevents term from being associated with other terms.
.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
Returns
Type | Description |
boolean | Whether the doNotAssociateAction field is set.
|
hasFilterAction()
public boolean hasFilterAction()
Filters results.
.google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10;
Returns
Type | Description |
boolean | Whether the filterAction field is set.
|
hasIgnoreAction()
public boolean hasIgnoreAction()
Ignores specific terms from query during search.
.google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9;
Returns
Type | Description |
boolean | Whether the ignoreAction field is set.
|
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;
Returns
Type | Description |
boolean | Whether the onewaySynonymsAction field is set.
|
hasRedirectAction()
public boolean hasRedirectAction()
Redirects a shopper to a specific page.
.google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3;
Returns
Type | Description |
boolean | Whether the redirectAction field is set.
|
hasReplacementAction()
public boolean hasReplacementAction()
Replaces specific terms in the query.
.google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8;
Returns
Type | Description |
boolean | Whether the replacementAction field is set.
|
hasTwowaySynonymsAction()
public boolean hasTwowaySynonymsAction()
Treats a set of terms as synonyms of one another.
.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;
Returns
Type | Description |
boolean | Whether the twowaySynonymsAction field is set.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public Rule.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Rule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public Rule.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions