Class Rule.ReplacementAction (2.33.0)

public static final class Rule.ReplacementAction extends GeneratedMessageV3 implements Rule.ReplacementActionOrBuilder

Replaces a term in the query. Multiple replacement candidates can be specified. All query_terms will be replaced with the replacement term. Example: Replace "gShoe" with "google shoe".

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

Static Fields

QUERY_TERMS_FIELD_NUMBER

public static final int QUERY_TERMS_FIELD_NUMBER
Field Value
TypeDescription
int

REPLACEMENT_TERM_FIELD_NUMBER

public static final int REPLACEMENT_TERM_FIELD_NUMBER
Field Value
TypeDescription
int

TERM_FIELD_NUMBER

public static final int TERM_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Rule.ReplacementAction getDefaultInstance()
Returns
TypeDescription
Rule.ReplacementAction

getDescriptor()

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

newBuilder()

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

newBuilder(Rule.ReplacementAction prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getDefaultInstanceForType()

public Rule.ReplacementAction getDefaultInstanceForType()
Returns
TypeDescription
Rule.ReplacementAction

getParserForType()

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

getQueryTerms(int index)

public String getQueryTerms(int index)

Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms.

repeated string query_terms = 2;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The queryTerms at the given index.

getQueryTermsBytes(int index)

public ByteString getQueryTermsBytes(int index)

Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms.

repeated string query_terms = 2;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the queryTerms at the given index.

getQueryTermsCount()

public int getQueryTermsCount()

Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms.

repeated string query_terms = 2;

Returns
TypeDescription
int

The count of queryTerms.

getQueryTermsList()

public ProtocolStringList getQueryTermsList()

Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms.

repeated string query_terms = 2;

Returns
TypeDescription
ProtocolStringList

A list containing the queryTerms.

getReplacementTerm()

public String getReplacementTerm()

Term that will be used for replacement.

string replacement_term = 3;

Returns
TypeDescription
String

The replacementTerm.

getReplacementTermBytes()

public ByteString getReplacementTermBytes()

Term that will be used for replacement.

string replacement_term = 3;

Returns
TypeDescription
ByteString

The bytes for replacementTerm.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getTerm()

public String getTerm()

Will be [deprecated = true] post migration;

string term = 1;

Returns
TypeDescription
String

The term.

getTermBytes()

public ByteString getTermBytes()

Will be [deprecated = true] post migration;

string term = 1;

Returns
TypeDescription
ByteString

The bytes for term.

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.ReplacementAction.Builder newBuilderForType()
Returns
TypeDescription
Rule.ReplacementAction.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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