Class CompletionSuggestion.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
com.google.cloud.discoveryengine.v1beta.CompletionSuggestion.Builder
- All Implemented Interfaces:
CompletionSuggestionOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- CompletionSuggestion
public static final class CompletionSuggestion.Builder
extends com.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
implements CompletionSuggestionOrBuilder
Autocomplete suggestions that are imported from Customer.Protobuf type
google.cloud.discoveryengine.v1beta.CompletionSuggestion-
Method Summary
Modifier and TypeMethodDescriptionaddAllAlternativePhrases(Iterable<String> values) Alternative matching phrases for this suggestion.addAlternativePhrases(String value) Alternative matching phrases for this suggestion.addAlternativePhrasesBytes(com.google.protobuf.ByteString value) Alternative matching phrases for this suggestion.build()clear()Alternative matching phrases for this suggestion.Frequency of this suggestion.Global score of this suggestion.If two suggestions have the same groupId, they will not be returned together.The score of this suggestion within its group.BCP-47 language code of this suggestion.Required.getAlternativePhrases(int index) Alternative matching phrases for this suggestion.com.google.protobuf.ByteStringgetAlternativePhrasesBytes(int index) Alternative matching phrases for this suggestion.intAlternative matching phrases for this suggestion.com.google.protobuf.ProtocolStringListAlternative matching phrases for this suggestion.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorlongFrequency of this suggestion.doubleGlobal score of this suggestion.If two suggestions have the same groupId, they will not be returned together.com.google.protobuf.ByteStringIf two suggestions have the same groupId, they will not be returned together.doubleThe score of this suggestion within its group.BCP-47 language code of this suggestion.com.google.protobuf.ByteStringBCP-47 language code of this suggestion.Required.com.google.protobuf.ByteStringRequired.booleanFrequency of this suggestion.booleanGlobal score of this suggestion.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(CompletionSuggestion other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setAlternativePhrases(int index, String value) Alternative matching phrases for this suggestion.setFrequency(long value) Frequency of this suggestion.setGlobalScore(double value) Global score of this suggestion.setGroupId(String value) If two suggestions have the same groupId, they will not be returned together.setGroupIdBytes(com.google.protobuf.ByteString value) If two suggestions have the same groupId, they will not be returned together.setGroupScore(double value) The score of this suggestion within its group.setLanguageCode(String value) BCP-47 language code of this suggestion.setLanguageCodeBytes(com.google.protobuf.ByteString value) BCP-47 language code of this suggestion.setSuggestion(String value) Required.setSuggestionBytes(com.google.protobuf.ByteString value) Required.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CompletionSuggestion.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
-
mergeFrom
public CompletionSuggestion.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CompletionSuggestion.Builder>- Throws:
IOException
-
getRankingInfoCase
- Specified by:
getRankingInfoCasein interfaceCompletionSuggestionOrBuilder
-
clearRankingInfo
-
hasGlobalScore
public boolean hasGlobalScore()Global score of this suggestion. Control how this suggestion would be scored / ranked.
double global_score = 2;- Specified by:
hasGlobalScorein interfaceCompletionSuggestionOrBuilder- Returns:
- Whether the globalScore field is set.
-
getGlobalScore
public double getGlobalScore()Global score of this suggestion. Control how this suggestion would be scored / ranked.
double global_score = 2;- Specified by:
getGlobalScorein interfaceCompletionSuggestionOrBuilder- Returns:
- The globalScore.
-
setGlobalScore
Global score of this suggestion. Control how this suggestion would be scored / ranked.
double global_score = 2;- Parameters:
value- The globalScore to set.- Returns:
- This builder for chaining.
-
clearGlobalScore
Global score of this suggestion. Control how this suggestion would be scored / ranked.
double global_score = 2;- Returns:
- This builder for chaining.
-
hasFrequency
public boolean hasFrequency()Frequency of this suggestion. Will be used to rank suggestions when score is not available.
int64 frequency = 3;- Specified by:
hasFrequencyin interfaceCompletionSuggestionOrBuilder- Returns:
- Whether the frequency field is set.
-
getFrequency
public long getFrequency()Frequency of this suggestion. Will be used to rank suggestions when score is not available.
int64 frequency = 3;- Specified by:
getFrequencyin interfaceCompletionSuggestionOrBuilder- Returns:
- The frequency.
-
setFrequency
Frequency of this suggestion. Will be used to rank suggestions when score is not available.
int64 frequency = 3;- Parameters:
value- The frequency to set.- Returns:
- This builder for chaining.
-
clearFrequency
Frequency of this suggestion. Will be used to rank suggestions when score is not available.
int64 frequency = 3;- Returns:
- This builder for chaining.
-
getSuggestion
Required. The suggestion text.
string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getSuggestionin interfaceCompletionSuggestionOrBuilder- Returns:
- The suggestion.
-
getSuggestionBytes
public com.google.protobuf.ByteString getSuggestionBytes()Required. The suggestion text.
string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getSuggestionBytesin interfaceCompletionSuggestionOrBuilder- Returns:
- The bytes for suggestion.
-
setSuggestion
Required. The suggestion text.
string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The suggestion to set.- Returns:
- This builder for chaining.
-
clearSuggestion
Required. The suggestion text.
string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
setSuggestionBytes
Required. The suggestion text.
string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The bytes for suggestion to set.- Returns:
- This builder for chaining.
-
getLanguageCode
BCP-47 language code of this suggestion.
string language_code = 4;- Specified by:
getLanguageCodein interfaceCompletionSuggestionOrBuilder- Returns:
- The languageCode.
-
getLanguageCodeBytes
public com.google.protobuf.ByteString getLanguageCodeBytes()BCP-47 language code of this suggestion.
string language_code = 4;- Specified by:
getLanguageCodeBytesin interfaceCompletionSuggestionOrBuilder- Returns:
- The bytes for languageCode.
-
setLanguageCode
BCP-47 language code of this suggestion.
string language_code = 4;- Parameters:
value- The languageCode to set.- Returns:
- This builder for chaining.
-
clearLanguageCode
BCP-47 language code of this suggestion.
string language_code = 4;- Returns:
- This builder for chaining.
-
setLanguageCodeBytes
BCP-47 language code of this suggestion.
string language_code = 4;- Parameters:
value- The bytes for languageCode to set.- Returns:
- This builder for chaining.
-
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;- Specified by:
getGroupIdin interfaceCompletionSuggestionOrBuilder- Returns:
- The groupId.
-
getGroupIdBytes
public com.google.protobuf.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;- Specified by:
getGroupIdBytesin interfaceCompletionSuggestionOrBuilder- Returns:
- The bytes for groupId.
-
setGroupId
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;- Parameters:
value- The groupId to set.- Returns:
- This builder for chaining.
-
clearGroupId
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:
- This builder for chaining.
-
setGroupIdBytes
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;- Parameters:
value- The bytes for groupId to set.- Returns:
- This builder for chaining.
-
getGroupScore
public double getGroupScore()The score of this suggestion within its group.
double group_score = 6;- Specified by:
getGroupScorein interfaceCompletionSuggestionOrBuilder- Returns:
- The groupScore.
-
setGroupScore
The score of this suggestion within its group.
double group_score = 6;- Parameters:
value- The groupScore to set.- Returns:
- This builder for chaining.
-
clearGroupScore
The score of this suggestion within its group.
double group_score = 6;- Returns:
- This builder for chaining.
-
getAlternativePhrasesList
public com.google.protobuf.ProtocolStringList getAlternativePhrasesList()Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Specified by:
getAlternativePhrasesListin interfaceCompletionSuggestionOrBuilder- Returns:
- A list containing the alternativePhrases.
-
getAlternativePhrasesCount
public int getAlternativePhrasesCount()Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Specified by:
getAlternativePhrasesCountin interfaceCompletionSuggestionOrBuilder- Returns:
- The count of alternativePhrases.
-
getAlternativePhrases
Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Specified by:
getAlternativePhrasesin interfaceCompletionSuggestionOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The alternativePhrases at the given index.
-
getAlternativePhrasesBytes
public com.google.protobuf.ByteString getAlternativePhrasesBytes(int index) Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Specified by:
getAlternativePhrasesBytesin interfaceCompletionSuggestionOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the alternativePhrases at the given index.
-
setAlternativePhrases
Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Parameters:
index- The index to set the value at.value- The alternativePhrases to set.- Returns:
- This builder for chaining.
-
addAlternativePhrases
Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Parameters:
value- The alternativePhrases to add.- Returns:
- This builder for chaining.
-
addAllAlternativePhrases
Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Parameters:
values- The alternativePhrases to add.- Returns:
- This builder for chaining.
-
clearAlternativePhrases
Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Returns:
- This builder for chaining.
-
addAlternativePhrasesBytes
public CompletionSuggestion.Builder addAlternativePhrasesBytes(com.google.protobuf.ByteString value) Alternative matching phrases for this suggestion.
repeated string alternative_phrases = 7;- Parameters:
value- The bytes of the alternativePhrases to add.- Returns:
- This builder for chaining.
-