Class Rule.ForceReturnFacetAction.Builder (2.56.0)

public static final class Rule.ForceReturnFacetAction.Builder extends GeneratedMessageV3.Builder<Rule.ForceReturnFacetAction.Builder> implements Rule.ForceReturnFacetActionOrBuilder

Force returns an attribute/facet in the request around a certain position or above.

  • Rule Condition: Must specify non-empty Condition.query_terms (for search only) or Condition.page_categories (for browse only), but can't specify both.

  • Action Inputs: attribute name, position

  • Action Result: Will force return a facet key around a certain position or above if the condition is satisfied.

    Example: Suppose the query is "shoes", the Condition.query_terms is "shoes", the ForceReturnFacetAction.FacetPositionAdjustment.attribute_name is "size" and the ForceReturnFacetAction.FacetPositionAdjustment.position is 8.

    Two cases: a) The facet key "size" is not already in the top 8 slots, then the facet "size" will appear at a position close to 8. b) The facet key "size" in among the top 8 positions in the request, then it will stay at its current rank.

Protobuf type google.cloud.retail.v2.Rule.ForceReturnFacetAction

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllFacetPositionAdjustments(Iterable<? extends Rule.ForceReturnFacetAction.FacetPositionAdjustment> values)

public Rule.ForceReturnFacetAction.Builder addAllFacetPositionAdjustments(Iterable<? extends Rule.ForceReturnFacetAction.FacetPositionAdjustment> values)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
values Iterable<? extends com.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment>
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

addFacetPositionAdjustments(Rule.ForceReturnFacetAction.FacetPositionAdjustment value)

public Rule.ForceReturnFacetAction.Builder addFacetPositionAdjustments(Rule.ForceReturnFacetAction.FacetPositionAdjustment value)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
value Rule.ForceReturnFacetAction.FacetPositionAdjustment
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

addFacetPositionAdjustments(Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder builderForValue)

public Rule.ForceReturnFacetAction.Builder addFacetPositionAdjustments(Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder builderForValue)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
builderForValue Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

addFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment value)

public Rule.ForceReturnFacetAction.Builder addFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment value)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameters
Name Description
index int
value Rule.ForceReturnFacetAction.FacetPositionAdjustment
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

addFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder builderForValue)

public Rule.ForceReturnFacetAction.Builder addFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder builderForValue)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameters
Name Description
index int
builderForValue Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

addFacetPositionAdjustmentsBuilder()

public Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder addFacetPositionAdjustmentsBuilder()

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Returns
Type Description
Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder

addFacetPositionAdjustmentsBuilder(int index)

public Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder addFacetPositionAdjustmentsBuilder(int index)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
index int
Returns
Type Description
Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Rule.ForceReturnFacetAction.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

build()

public Rule.ForceReturnFacetAction build()
Returns
Type Description
Rule.ForceReturnFacetAction

buildPartial()

public Rule.ForceReturnFacetAction buildPartial()
Returns
Type Description
Rule.ForceReturnFacetAction

clear()

public Rule.ForceReturnFacetAction.Builder clear()
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

clearFacetPositionAdjustments()

public Rule.ForceReturnFacetAction.Builder clearFacetPositionAdjustments()

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Returns
Type Description
Rule.ForceReturnFacetAction.Builder

clearField(Descriptors.FieldDescriptor field)

public Rule.ForceReturnFacetAction.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Rule.ForceReturnFacetAction.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

clone()

public Rule.ForceReturnFacetAction.Builder clone()
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

getDefaultInstanceForType()

public Rule.ForceReturnFacetAction getDefaultInstanceForType()
Returns
Type Description
Rule.ForceReturnFacetAction

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getFacetPositionAdjustments(int index)

public Rule.ForceReturnFacetAction.FacetPositionAdjustment getFacetPositionAdjustments(int index)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
index int
Returns
Type Description
Rule.ForceReturnFacetAction.FacetPositionAdjustment

getFacetPositionAdjustmentsBuilder(int index)

public Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder getFacetPositionAdjustmentsBuilder(int index)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
index int
Returns
Type Description
Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder

getFacetPositionAdjustmentsBuilderList()

public List<Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder> getFacetPositionAdjustmentsBuilderList()

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Returns
Type Description
List<Builder>

getFacetPositionAdjustmentsCount()

public int getFacetPositionAdjustmentsCount()

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Returns
Type Description
int

getFacetPositionAdjustmentsList()

public List<Rule.ForceReturnFacetAction.FacetPositionAdjustment> getFacetPositionAdjustmentsList()

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Returns
Type Description
List<FacetPositionAdjustment>

getFacetPositionAdjustmentsOrBuilder(int index)

public Rule.ForceReturnFacetAction.FacetPositionAdjustmentOrBuilder getFacetPositionAdjustmentsOrBuilder(int index)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
index int
Returns
Type Description
Rule.ForceReturnFacetAction.FacetPositionAdjustmentOrBuilder

getFacetPositionAdjustmentsOrBuilderList()

public List<? extends Rule.ForceReturnFacetAction.FacetPositionAdjustmentOrBuilder> getFacetPositionAdjustmentsOrBuilderList()

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Returns
Type Description
List<? extends com.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustmentOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Rule.ForceReturnFacetAction other)

public Rule.ForceReturnFacetAction.Builder mergeFrom(Rule.ForceReturnFacetAction other)
Parameter
Name Description
other Rule.ForceReturnFacetAction
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Rule.ForceReturnFacetAction.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Rule.ForceReturnFacetAction.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Rule.ForceReturnFacetAction.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

removeFacetPositionAdjustments(int index)

public Rule.ForceReturnFacetAction.Builder removeFacetPositionAdjustments(int index)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameter
Name Description
index int
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

setFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment value)

public Rule.ForceReturnFacetAction.Builder setFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment value)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameters
Name Description
index int
value Rule.ForceReturnFacetAction.FacetPositionAdjustment
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

setFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder builderForValue)

public Rule.ForceReturnFacetAction.Builder setFacetPositionAdjustments(int index, Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder builderForValue)

Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1;

Parameters
Name Description
index int
builderForValue Rule.ForceReturnFacetAction.FacetPositionAdjustment.Builder
Returns
Type Description
Rule.ForceReturnFacetAction.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Rule.ForceReturnFacetAction.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Rule.ForceReturnFacetAction.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Rule.ForceReturnFacetAction.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Rule.ForceReturnFacetAction.Builder
Overrides