Class Condition (2.55.0)

public final class Condition extends GeneratedMessageV3 implements ConditionOrBuilder

Metadata that is used to define a condition that triggers an action. A valid condition must specify at least one of 'query_terms' or 'products_filter'. If multiple fields are specified, the condition is met if all the fields are satisfied e.g. if a set of query terms and product_filter are set, then only items matching the product_filter for requests with a query matching the query terms wil get boosted.

Protobuf type google.cloud.retail.v2alpha.Condition

Implements

ConditionOrBuilder

Static Fields

ACTIVE_TIME_RANGE_FIELD_NUMBER

public static final int ACTIVE_TIME_RANGE_FIELD_NUMBER
Field Value
Type Description
int

PAGE_CATEGORIES_FIELD_NUMBER

public static final int PAGE_CATEGORIES_FIELD_NUMBER
Field Value
Type Description
int

QUERY_TERMS_FIELD_NUMBER

public static final int QUERY_TERMS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Condition getDefaultInstance()
Returns
Type Description
Condition

getDescriptor()

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

newBuilder()

public static Condition.Builder newBuilder()
Returns
Type Description
Condition.Builder

newBuilder(Condition prototype)

public static Condition.Builder newBuilder(Condition prototype)
Parameter
Name Description
prototype Condition
Returns
Type Description
Condition.Builder

parseDelimitedFrom(InputStream input)

public static Condition parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Condition
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Condition parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Condition
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Condition parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Condition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Condition parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Condition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Condition parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Condition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Condition parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Condition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Condition parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Condition
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Condition parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Condition
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Condition parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Condition
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Condition parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Condition
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Condition parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Condition
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Condition parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Condition
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Condition> parser()
Returns
Type Description
Parser<Condition>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getActiveTimeRange(int index)

public Condition.TimeRange getActiveTimeRange(int index)

Range of time(s) specifying when Condition is active. Condition true if any time range matches.

repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3;

Parameter
Name Description
index int
Returns
Type Description
Condition.TimeRange

getActiveTimeRangeCount()

public int getActiveTimeRangeCount()

Range of time(s) specifying when Condition is active. Condition true if any time range matches.

repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3;

Returns
Type Description
int

getActiveTimeRangeList()

public List<Condition.TimeRange> getActiveTimeRangeList()

Range of time(s) specifying when Condition is active. Condition true if any time range matches.

repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3;

Returns
Type Description
List<TimeRange>

getActiveTimeRangeOrBuilder(int index)

public Condition.TimeRangeOrBuilder getActiveTimeRangeOrBuilder(int index)

Range of time(s) specifying when Condition is active. Condition true if any time range matches.

repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3;

Parameter
Name Description
index int
Returns
Type Description
Condition.TimeRangeOrBuilder

getActiveTimeRangeOrBuilderList()

public List<? extends Condition.TimeRangeOrBuilder> getActiveTimeRangeOrBuilderList()

Range of time(s) specifying when Condition is active. Condition true if any time range matches.

repeated .google.cloud.retail.v2alpha.Condition.TimeRange active_time_range = 3;

Returns
Type Description
List<? extends com.google.cloud.retail.v2alpha.Condition.TimeRangeOrBuilder>

getDefaultInstanceForType()

public Condition getDefaultInstanceForType()
Returns
Type Description
Condition

getPageCategories(int index)

public String getPageCategories(int index)

Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

repeated string page_categories = 4;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The pageCategories at the given index.

getPageCategoriesBytes(int index)

public ByteString getPageCategoriesBytes(int index)

Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

repeated string page_categories = 4;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the pageCategories at the given index.

getPageCategoriesCount()

public int getPageCategoriesCount()

Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

repeated string page_categories = 4;

Returns
Type Description
int

The count of pageCategories.

getPageCategoriesList()

public ProtocolStringList getPageCategoriesList()

Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;

repeated string page_categories = 4;

Returns
Type Description
ProtocolStringList

A list containing the pageCategories.

getParserForType()

public Parser<Condition> getParserForType()
Returns
Type Description
Parser<Condition>
Overrides

getQueryTerms(int index)

public Condition.QueryTerm getQueryTerms(int index)

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1;

Parameter
Name Description
index int
Returns
Type Description
Condition.QueryTerm

getQueryTermsCount()

public int getQueryTermsCount()

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1;

Returns
Type Description
int

getQueryTermsList()

public List<Condition.QueryTerm> getQueryTermsList()

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1;

Returns
Type Description
List<QueryTerm>

getQueryTermsOrBuilder(int index)

public Condition.QueryTermOrBuilder getQueryTermsOrBuilder(int index)

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1;

Parameter
Name Description
index int
Returns
Type Description
Condition.QueryTermOrBuilder

getQueryTermsOrBuilderList()

public List<? extends Condition.QueryTermOrBuilder> getQueryTermsOrBuilderList()

A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

repeated .google.cloud.retail.v2alpha.Condition.QueryTerm query_terms = 1;

Returns
Type Description
List<? extends com.google.cloud.retail.v2alpha.Condition.QueryTermOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Condition.Builder newBuilderForType()
Returns
Type Description
Condition.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Condition.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Condition.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Condition.Builder toBuilder()
Returns
Type Description
Condition.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException