Class Rule (2.34.0)

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.v2beta.Rule

Implements

RuleOrBuilder

Static Fields

BOOST_ACTION_FIELD_NUMBER

public static final int BOOST_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

CONDITION_FIELD_NUMBER

public static final int CONDITION_FIELD_NUMBER
Field Value
TypeDescription
int

DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER

public static final int DO_NOT_ASSOCIATE_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

FILTER_ACTION_FIELD_NUMBER

public static final int FILTER_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

IGNORE_ACTION_FIELD_NUMBER

public static final int IGNORE_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER

public static final int ONEWAY_SYNONYMS_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

REDIRECT_ACTION_FIELD_NUMBER

public static final int REDIRECT_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

REPLACEMENT_ACTION_FIELD_NUMBER

public static final int REPLACEMENT_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER

public static final int TWOWAY_SYNONYMS_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Rule getDefaultInstance()
Returns
TypeDescription
Rule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Rule.Builder newBuilder()
Returns
TypeDescription
Rule.Builder

newBuilder(Rule prototype)

public static Rule.Builder newBuilder(Rule prototype)
Parameter
NameDescription
prototypeRule
Returns
TypeDescription
Rule.Builder

parseDelimitedFrom(InputStream input)

public static Rule parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Rule
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Rule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rule
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Rule parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Rule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Rule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Rule parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Rule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Rule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Rule parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Rule
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Rule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Rule parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Rule
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Rule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rule
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Rule parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Rule
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Rule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rule
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Rule> parser()
Returns
TypeDescription
Parser<Rule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getActionCase()

public Rule.ActionCase getActionCase()
Returns
TypeDescription
Rule.ActionCase

getBoostAction()

public Rule.BoostAction getBoostAction()

A boost action.

.google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;

Returns
TypeDescription
Rule.BoostAction

The boostAction.

getBoostActionOrBuilder()

public Rule.BoostActionOrBuilder getBoostActionOrBuilder()

A boost action.

.google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;

Returns
TypeDescription
Rule.BoostActionOrBuilder

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];

Returns
TypeDescription
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.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ConditionOrBuilder

getDefaultInstanceForType()

public Rule getDefaultInstanceForType()
Returns
TypeDescription
Rule

getDoNotAssociateAction()

public Rule.DoNotAssociateAction getDoNotAssociateAction()

Prevents term from being associated with other terms.

.google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;

Returns
TypeDescription
Rule.DoNotAssociateAction

The doNotAssociateAction.

getDoNotAssociateActionOrBuilder()

public Rule.DoNotAssociateActionOrBuilder getDoNotAssociateActionOrBuilder()

Prevents term from being associated with other terms.

.google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;

Returns
TypeDescription
Rule.DoNotAssociateActionOrBuilder

getFilterAction()

public Rule.FilterAction getFilterAction()

Filters results.

.google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;

Returns
TypeDescription
Rule.FilterAction

The filterAction.

getFilterActionOrBuilder()

public Rule.FilterActionOrBuilder getFilterActionOrBuilder()

Filters results.

.google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;

Returns
TypeDescription
Rule.FilterActionOrBuilder

getIgnoreAction()

public Rule.IgnoreAction getIgnoreAction()

Ignores specific terms from query during search.

.google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;

Returns
TypeDescription
Rule.IgnoreAction

The ignoreAction.

getIgnoreActionOrBuilder()

public Rule.IgnoreActionOrBuilder getIgnoreActionOrBuilder()

Ignores specific terms from query during search.

.google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;

Returns
TypeDescription
Rule.IgnoreActionOrBuilder

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;

Returns
TypeDescription
Rule.OnewaySynonymsAction

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.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;

Returns
TypeDescription
Rule.OnewaySynonymsActionOrBuilder

getParserForType()

public Parser<Rule> getParserForType()
Returns
TypeDescription
Parser<Rule>
Overrides

getRedirectAction()

public Rule.RedirectAction getRedirectAction()

Redirects a shopper to a specific page.

.google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;

Returns
TypeDescription
Rule.RedirectAction

The redirectAction.

getRedirectActionOrBuilder()

public Rule.RedirectActionOrBuilder getRedirectActionOrBuilder()

Redirects a shopper to a specific page.

.google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;

Returns
TypeDescription
Rule.RedirectActionOrBuilder

getReplacementAction()

public Rule.ReplacementAction getReplacementAction()

Replaces specific terms in the query.

.google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;

Returns
TypeDescription
Rule.ReplacementAction

The replacementAction.

getReplacementActionOrBuilder()

public Rule.ReplacementActionOrBuilder getReplacementActionOrBuilder()

Replaces specific terms in the query.

.google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;

Returns
TypeDescription
Rule.ReplacementActionOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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;

Returns
TypeDescription
Rule.TwowaySynonymsAction

The twowaySynonymsAction.

getTwowaySynonymsActionOrBuilder()

public Rule.TwowaySynonymsActionOrBuilder getTwowaySynonymsActionOrBuilder()

Treats a set of terms as synonyms of one another.

.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;

Returns
TypeDescription
Rule.TwowaySynonymsActionOrBuilder

hasBoostAction()

public boolean hasBoostAction()

A boost action.

.google.cloud.retail.v2beta.Rule.BoostAction boost_action = 2;

Returns
TypeDescription
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.v2beta.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the condition field is set.

hasDoNotAssociateAction()

public boolean hasDoNotAssociateAction()

Prevents term from being associated with other terms.

.google.cloud.retail.v2beta.Rule.DoNotAssociateAction do_not_associate_action = 7;

Returns
TypeDescription
boolean

Whether the doNotAssociateAction field is set.

hasFilterAction()

public boolean hasFilterAction()

Filters results.

.google.cloud.retail.v2beta.Rule.FilterAction filter_action = 10;

Returns
TypeDescription
boolean

Whether the filterAction field is set.

hasIgnoreAction()

public boolean hasIgnoreAction()

Ignores specific terms from query during search.

.google.cloud.retail.v2beta.Rule.IgnoreAction ignore_action = 9;

Returns
TypeDescription
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.v2beta.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;

Returns
TypeDescription
boolean

Whether the onewaySynonymsAction field is set.

hasRedirectAction()

public boolean hasRedirectAction()

Redirects a shopper to a specific page.

.google.cloud.retail.v2beta.Rule.RedirectAction redirect_action = 3;

Returns
TypeDescription
boolean

Whether the redirectAction field is set.

hasReplacementAction()

public boolean hasReplacementAction()

Replaces specific terms in the query.

.google.cloud.retail.v2beta.Rule.ReplacementAction replacement_action = 8;

Returns
TypeDescription
boolean

Whether the replacementAction field is set.

hasTwowaySynonymsAction()

public boolean hasTwowaySynonymsAction()

Treats a set of terms as synonyms of one another.

.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;

Returns
TypeDescription
boolean

Whether the twowaySynonymsAction field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Rule.Builder newBuilderForType()
Returns
TypeDescription
Rule.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Rule.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Rule.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Rule.Builder toBuilder()
Returns
TypeDescription
Rule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException