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 rules only work for controls
with
SOLUTION_TYPE_SEARCH.
Protobuf type google.cloud.retail.v2alpha.Rule
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
Static Fields
BOOST_ACTION_FIELD_NUMBER
public static final int BOOST_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
CONDITION_FIELD_NUMBER
public static final int CONDITION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
FILTER_ACTION_FIELD_NUMBER
public static final int FILTER_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
IGNORE_ACTION_FIELD_NUMBER
public static final int IGNORE_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
REDIRECT_ACTION_FIELD_NUMBER
public static final int REDIRECT_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
REPLACEMENT_ACTION_FIELD_NUMBER
public static final int REPLACEMENT_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
Static Methods
getDefaultInstance()
public static Rule getDefaultInstance()
Returns |
---|
Type | Description |
Rule | |
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Rule.Builder newBuilder()
newBuilder(Rule prototype)
public static Rule.Builder newBuilder(Rule prototype)
Parameter |
---|
Name | Description |
prototype | Rule
|
public static Rule parseDelimitedFrom(InputStream input)
Returns |
---|
Type | Description |
Rule | |
public static Rule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Returns |
---|
Type | Description |
Rule | |
parseFrom(byte[] data)
public static Rule parseFrom(byte[] data)
Parameter |
---|
Name | Description |
data | byte[]
|
Returns |
---|
Type | Description |
Rule | |
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Rule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Returns |
---|
Type | Description |
Rule | |
parseFrom(ByteString data)
public static Rule parseFrom(ByteString data)
Returns |
---|
Type | Description |
Rule | |
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Rule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Returns |
---|
Type | Description |
Rule | |
public static Rule parseFrom(CodedInputStream input)
Returns |
---|
Type | Description |
Rule | |
public static Rule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Returns |
---|
Type | Description |
Rule | |
public static Rule parseFrom(InputStream input)
Returns |
---|
Type | Description |
Rule | |
public static Rule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Returns |
---|
Type | Description |
Rule | |
parseFrom(ByteBuffer data)
public static Rule parseFrom(ByteBuffer data)
Returns |
---|
Type | Description |
Rule | |
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Rule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Returns |
---|
Type | Description |
Rule | |
parser()
public static Parser<Rule> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
---|
Name | Description |
obj | Object
|
Overrides
getActionCase()
public Rule.ActionCase getActionCase()
getBoostAction()
public Rule.BoostAction getBoostAction()
A boost action.
.google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2;
getBoostActionOrBuilder()
public Rule.BoostActionOrBuilder getBoostActionOrBuilder()
A boost action.
.google.cloud.retail.v2alpha.Rule.BoostAction boost_action = 2;
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 |
---|
Type | Description |
Condition | 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];
getDefaultInstanceForType()
public Rule getDefaultInstanceForType()
Returns |
---|
Type | Description |
Rule | |
getDoNotAssociateAction()
public Rule.DoNotAssociateAction getDoNotAssociateAction()
Prevents term from being associated with other terms.
.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
getDoNotAssociateActionOrBuilder()
public Rule.DoNotAssociateActionOrBuilder getDoNotAssociateActionOrBuilder()
Prevents term from being associated with other terms.
.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction do_not_associate_action = 7;
getFilterAction()
public Rule.FilterAction getFilterAction()
Filters results.
.google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10;
getFilterActionOrBuilder()
public Rule.FilterActionOrBuilder getFilterActionOrBuilder()
Filters results.
.google.cloud.retail.v2alpha.Rule.FilterAction filter_action = 10;
getIgnoreAction()
public Rule.IgnoreAction getIgnoreAction()
Ignores specific terms from query during search.
.google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9;
getIgnoreActionOrBuilder()
public Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder()
Ignores specific terms from query during search.
.google.cloud.retail.v2alpha.Rule.IgnoreAction ignore_action = 9;
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;
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;
getParserForType()
public Parser<Rule> getParserForType()
Overrides
getRedirectAction()
public Rule.RedirectAction getRedirectAction()
Redirects a shopper to a specific page.
.google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3;
getRedirectActionOrBuilder()
public Rule.RedirectActionOrBuilder getRedirectActionOrBuilder()
Redirects a shopper to a specific page.
.google.cloud.retail.v2alpha.Rule.RedirectAction redirect_action = 3;
getReplacementAction()
public Rule.ReplacementAction getReplacementAction()
Replaces specific terms in the query.
.google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8;
getReplacementActionOrBuilder()
public Rule.ReplacementActionOrBuilder getReplacementActionOrBuilder()
Replaces specific terms in the query.
.google.cloud.retail.v2alpha.Rule.ReplacementAction replacement_action = 8;
getSerializedSize()
public int getSerializedSize()
Returns |
---|
Type | Description |
int | |
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;
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;
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
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 |
---|
Type | Description |
int | |
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Rule.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Rule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Overrides
toBuilder()
public Rule.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides