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 Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<CompletionSuggestion.Builder>
    • getDefaultInstanceForType

      public CompletionSuggestion getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public CompletionSuggestion build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public CompletionSuggestion buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public CompletionSuggestion.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CompletionSuggestion.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CompletionSuggestion.Builder>
      Throws:
      IOException
    • getRankingInfoCase

      public CompletionSuggestion.RankingInfoCase getRankingInfoCase()
      Specified by:
      getRankingInfoCase in interface CompletionSuggestionOrBuilder
    • clearRankingInfo

      public CompletionSuggestion.Builder clearRankingInfo()
    • hasGlobalScore

      public boolean hasGlobalScore()
       Global score of this suggestion. Control how this suggestion would be
       scored / ranked.
       
      double global_score = 2;
      Specified by:
      hasGlobalScore in interface CompletionSuggestionOrBuilder
      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:
      getGlobalScore in interface CompletionSuggestionOrBuilder
      Returns:
      The globalScore.
    • setGlobalScore

      public CompletionSuggestion.Builder setGlobalScore(double value)
       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

      public CompletionSuggestion.Builder 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:
      hasFrequency in interface CompletionSuggestionOrBuilder
      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:
      getFrequency in interface CompletionSuggestionOrBuilder
      Returns:
      The frequency.
    • setFrequency

      public CompletionSuggestion.Builder setFrequency(long value)
       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

      public CompletionSuggestion.Builder 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

      public String getSuggestion()
       Required. The suggestion text.
       
      string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSuggestion in interface CompletionSuggestionOrBuilder
      Returns:
      The suggestion.
    • getSuggestionBytes

      public com.google.protobuf.ByteString getSuggestionBytes()
       Required. The suggestion text.
       
      string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSuggestionBytes in interface CompletionSuggestionOrBuilder
      Returns:
      The bytes for suggestion.
    • setSuggestion

      public CompletionSuggestion.Builder setSuggestion(String value)
       Required. The suggestion text.
       
      string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The suggestion to set.
      Returns:
      This builder for chaining.
    • clearSuggestion

      public CompletionSuggestion.Builder clearSuggestion()
       Required. The suggestion text.
       
      string suggestion = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setSuggestionBytes

      public CompletionSuggestion.Builder setSuggestionBytes(com.google.protobuf.ByteString value)
       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

      public String getLanguageCode()
       BCP-47 language code of this suggestion.
       
      string language_code = 4;
      Specified by:
      getLanguageCode in interface CompletionSuggestionOrBuilder
      Returns:
      The languageCode.
    • getLanguageCodeBytes

      public com.google.protobuf.ByteString getLanguageCodeBytes()
       BCP-47 language code of this suggestion.
       
      string language_code = 4;
      Specified by:
      getLanguageCodeBytes in interface CompletionSuggestionOrBuilder
      Returns:
      The bytes for languageCode.
    • setLanguageCode

      public CompletionSuggestion.Builder setLanguageCode(String value)
       BCP-47 language code of this suggestion.
       
      string language_code = 4;
      Parameters:
      value - The languageCode to set.
      Returns:
      This builder for chaining.
    • clearLanguageCode

      public CompletionSuggestion.Builder clearLanguageCode()
       BCP-47 language code of this suggestion.
       
      string language_code = 4;
      Returns:
      This builder for chaining.
    • setLanguageCodeBytes

      public CompletionSuggestion.Builder setLanguageCodeBytes(com.google.protobuf.ByteString value)
       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

      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;
      Specified by:
      getGroupId in interface CompletionSuggestionOrBuilder
      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:
      getGroupIdBytes in interface CompletionSuggestionOrBuilder
      Returns:
      The bytes for groupId.
    • setGroupId

      public CompletionSuggestion.Builder setGroupId(String value)
       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

      public CompletionSuggestion.Builder 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

      public CompletionSuggestion.Builder setGroupIdBytes(com.google.protobuf.ByteString value)
       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:
      getGroupScore in interface CompletionSuggestionOrBuilder
      Returns:
      The groupScore.
    • setGroupScore

      public CompletionSuggestion.Builder setGroupScore(double value)
       The score of this suggestion within its group.
       
      double group_score = 6;
      Parameters:
      value - The groupScore to set.
      Returns:
      This builder for chaining.
    • clearGroupScore

      public CompletionSuggestion.Builder 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:
      getAlternativePhrasesList in interface CompletionSuggestionOrBuilder
      Returns:
      A list containing the alternativePhrases.
    • getAlternativePhrasesCount

      public int getAlternativePhrasesCount()
       Alternative matching phrases for this suggestion.
       
      repeated string alternative_phrases = 7;
      Specified by:
      getAlternativePhrasesCount in interface CompletionSuggestionOrBuilder
      Returns:
      The count of alternativePhrases.
    • getAlternativePhrases

      public String getAlternativePhrases(int index)
       Alternative matching phrases for this suggestion.
       
      repeated string alternative_phrases = 7;
      Specified by:
      getAlternativePhrases in interface CompletionSuggestionOrBuilder
      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:
      getAlternativePhrasesBytes in interface CompletionSuggestionOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the alternativePhrases at the given index.
    • setAlternativePhrases

      public CompletionSuggestion.Builder setAlternativePhrases(int index, String value)
       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

      public CompletionSuggestion.Builder addAlternativePhrases(String value)
       Alternative matching phrases for this suggestion.
       
      repeated string alternative_phrases = 7;
      Parameters:
      value - The alternativePhrases to add.
      Returns:
      This builder for chaining.
    • addAllAlternativePhrases

      public CompletionSuggestion.Builder addAllAlternativePhrases(Iterable<String> values)
       Alternative matching phrases for this suggestion.
       
      repeated string alternative_phrases = 7;
      Parameters:
      values - The alternativePhrases to add.
      Returns:
      This builder for chaining.
    • clearAlternativePhrases

      public CompletionSuggestion.Builder 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.