Class SearchResponse.Summary.SafetyAttributes.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<SearchResponse.Summary.SafetyAttributes.Builder>
com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes.Builder
All Implemented Interfaces:
SearchResponse.Summary.SafetyAttributesOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
SearchResponse.Summary.SafetyAttributes

public static final class SearchResponse.Summary.SafetyAttributes.Builder extends com.google.protobuf.GeneratedMessage.Builder<SearchResponse.Summary.SafetyAttributes.Builder> implements SearchResponse.Summary.SafetyAttributesOrBuilder
 Safety Attribute categories and their associated confidence scores.
 
Protobuf type google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes
  • 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<SearchResponse.Summary.SafetyAttributes.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<SearchResponse.Summary.SafetyAttributes.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<SearchResponse.Summary.SafetyAttributes.Builder>
    • getDefaultInstanceForType

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public SearchResponse.Summary.SafetyAttributes.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<SearchResponse.Summary.SafetyAttributes.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<SearchResponse.Summary.SafetyAttributes.Builder>
    • mergeFrom

      public SearchResponse.Summary.SafetyAttributes.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<SearchResponse.Summary.SafetyAttributes.Builder>
      Throws:
      IOException
    • getCategoriesList

      public com.google.protobuf.ProtocolStringList getCategoriesList()
       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Specified by:
      getCategoriesList in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Returns:
      A list containing the categories.
    • getCategoriesCount

      public int getCategoriesCount()
       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Specified by:
      getCategoriesCount in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Returns:
      The count of categories.
    • getCategories

      public String getCategories(int index)
       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Specified by:
      getCategories in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The categories at the given index.
    • getCategoriesBytes

      public com.google.protobuf.ByteString getCategoriesBytes(int index)
       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Specified by:
      getCategoriesBytes in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the categories at the given index.
    • setCategories

      public SearchResponse.Summary.SafetyAttributes.Builder setCategories(int index, String value)
       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Parameters:
      index - The index to set the value at.
      value - The categories to set.
      Returns:
      This builder for chaining.
    • addCategories

       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Parameters:
      value - The categories to add.
      Returns:
      This builder for chaining.
    • addAllCategories

       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Parameters:
      values - The categories to add.
      Returns:
      This builder for chaining.
    • clearCategories

       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Returns:
      This builder for chaining.
    • addCategoriesBytes

      public SearchResponse.Summary.SafetyAttributes.Builder addCategoriesBytes(com.google.protobuf.ByteString value)
       The display names of Safety Attribute categories associated with the
       generated content. Order matches the Scores.
       
      repeated string categories = 1;
      Parameters:
      value - The bytes of the categories to add.
      Returns:
      This builder for chaining.
    • getScoresList

      public List<Float> getScoresList()
       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Specified by:
      getScoresList in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Returns:
      A list containing the scores.
    • getScoresCount

      public int getScoresCount()
       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Specified by:
      getScoresCount in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Returns:
      The count of scores.
    • getScores

      public float getScores(int index)
       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Specified by:
      getScores in interface SearchResponse.Summary.SafetyAttributesOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The scores at the given index.
    • setScores

      public SearchResponse.Summary.SafetyAttributes.Builder setScores(int index, float value)
       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Parameters:
      index - The index to set the value at.
      value - The scores to set.
      Returns:
      This builder for chaining.
    • addScores

      public SearchResponse.Summary.SafetyAttributes.Builder addScores(float value)
       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Parameters:
      value - The scores to add.
      Returns:
      This builder for chaining.
    • addAllScores

      public SearchResponse.Summary.SafetyAttributes.Builder addAllScores(Iterable<? extends Float> values)
       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Parameters:
      values - The scores to add.
      Returns:
      This builder for chaining.
    • clearScores

       The confidence scores of the each category, higher
       value means higher confidence. Order matches the Categories.
       
      repeated float scores = 2;
      Returns:
      This builder for chaining.