Class CompletionSuggestion (0.50.0)

public final class CompletionSuggestion extends GeneratedMessageV3 implements CompletionSuggestionOrBuilder

Autocomplete suggestions that are imported from Customer.

Protobuf type google.cloud.discoveryengine.v1alpha.CompletionSuggestion

Static Fields

ALTERNATIVE_PHRASES_FIELD_NUMBER

public static final int ALTERNATIVE_PHRASES_FIELD_NUMBER
Field Value
Type Description
int

FREQUENCY_FIELD_NUMBER

public static final int FREQUENCY_FIELD_NUMBER
Field Value
Type Description
int

GLOBAL_SCORE_FIELD_NUMBER

public static final int GLOBAL_SCORE_FIELD_NUMBER
Field Value
Type Description
int

GROUP_ID_FIELD_NUMBER

public static final int GROUP_ID_FIELD_NUMBER
Field Value
Type Description
int

GROUP_SCORE_FIELD_NUMBER

public static final int GROUP_SCORE_FIELD_NUMBER
Field Value
Type Description
int

LANGUAGE_CODE_FIELD_NUMBER

public static final int LANGUAGE_CODE_FIELD_NUMBER
Field Value
Type Description
int

SUGGESTION_FIELD_NUMBER

public static final int SUGGESTION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CompletionSuggestion getDefaultInstance()
Returns
Type Description
CompletionSuggestion

getDescriptor()

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

newBuilder()

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

newBuilder(CompletionSuggestion prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getAlternativePhrases(int index)

public String getAlternativePhrases(int index)

Alternative matching phrases for this suggestion.

repeated string alternative_phrases = 7;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The alternativePhrases at the given index.

getAlternativePhrasesBytes(int index)

public ByteString getAlternativePhrasesBytes(int index)

Alternative matching phrases for this suggestion.

repeated string alternative_phrases = 7;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the alternativePhrases at the given index.

getAlternativePhrasesCount()

public int getAlternativePhrasesCount()

Alternative matching phrases for this suggestion.

repeated string alternative_phrases = 7;

Returns
Type Description
int

The count of alternativePhrases.

getAlternativePhrasesList()

public ProtocolStringList getAlternativePhrasesList()

Alternative matching phrases for this suggestion.

repeated string alternative_phrases = 7;

Returns
Type Description
ProtocolStringList

A list containing the alternativePhrases.

getDefaultInstanceForType()

public CompletionSuggestion getDefaultInstanceForType()
Returns
Type Description
CompletionSuggestion

getFrequency()

public long getFrequency()

Frequency of this suggestion. Will be used to rank suggestions when score is not available.

int64 frequency = 3;

Returns
Type Description
long

The frequency.

getGlobalScore()

public double getGlobalScore()

Global score of this suggestion. Control how this suggestion would be scored / ranked.

double global_score = 2;

Returns
Type Description
double

The globalScore.

getGroupId()

public String getGroupId()

If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.

string group_id = 5;

Returns
Type Description
String

The groupId.

getGroupIdBytes()

public ByteString getGroupIdBytes()

If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.

string group_id = 5;

Returns
Type Description
ByteString

The bytes for groupId.

getGroupScore()

public double getGroupScore()

The score of this suggestion within its group.

double group_score = 6;

Returns
Type Description
double

The groupScore.

getLanguageCode()

public String getLanguageCode()

BCP-47 language code of this suggestion.

string language_code = 4;

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

BCP-47 language code of this suggestion.

string language_code = 4;

Returns
Type Description
ByteString

The bytes for languageCode.

getParserForType()

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

getRankingInfoCase()

public CompletionSuggestion.RankingInfoCase getRankingInfoCase()
Returns
Type Description
CompletionSuggestion.RankingInfoCase

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSuggestion()

public String getSuggestion()

Required. The suggestion text.

string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The suggestion.

getSuggestionBytes()

public ByteString getSuggestionBytes()

Required. The suggestion text.

string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for suggestion.

hasFrequency()

public boolean hasFrequency()

Frequency of this suggestion. Will be used to rank suggestions when score is not available.

int64 frequency = 3;

Returns
Type Description
boolean

Whether the frequency field is set.

hasGlobalScore()

public boolean hasGlobalScore()

Global score of this suggestion. Control how this suggestion would be scored / ranked.

double global_score = 2;

Returns
Type Description
boolean

Whether the globalScore field is set.

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 CompletionSuggestion.Builder newBuilderForType()
Returns
Type Description
CompletionSuggestion.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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