Class SearchHypernym.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<SearchHypernym.Builder>
com.google.cloud.visionai.v1.SearchHypernym.Builder
All Implemented Interfaces:
SearchHypernymOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
SearchHypernym

public static final class SearchHypernym.Builder extends com.google.protobuf.GeneratedMessage.Builder<SearchHypernym.Builder> implements SearchHypernymOrBuilder
 Search resource: SearchHypernym.
 For example,
 { hypernym: "vehicle"
 hyponyms: ["sedan", "truck"] }
 This means in SMART_SEARCH mode, searching for "vehicle" will also return
 results with "sedan" or "truck" as annotations.
 
Protobuf type google.cloud.visionai.v1.SearchHypernym
  • 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<SearchHypernym.Builder>
    • clear

      public SearchHypernym.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<SearchHypernym.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<SearchHypernym.Builder>
    • getDefaultInstanceForType

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

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

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

      public SearchHypernym.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<SearchHypernym.Builder>
    • mergeFrom

      public SearchHypernym.Builder mergeFrom(SearchHypernym other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<SearchHypernym.Builder>
    • mergeFrom

      public SearchHypernym.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<SearchHypernym.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       Resource name of the SearchHypernym.
       Format:
       `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
       
      string name = 1;
      Specified by:
      getName in interface SearchHypernymOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Resource name of the SearchHypernym.
       Format:
       `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
       
      string name = 1;
      Specified by:
      getNameBytes in interface SearchHypernymOrBuilder
      Returns:
      The bytes for name.
    • setName

      public SearchHypernym.Builder setName(String value)
       Resource name of the SearchHypernym.
       Format:
       `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
       
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public SearchHypernym.Builder clearName()
       Resource name of the SearchHypernym.
       Format:
       `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
       
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public SearchHypernym.Builder setNameBytes(com.google.protobuf.ByteString value)
       Resource name of the SearchHypernym.
       Format:
       `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
       
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getHypernym

      public String getHypernym()
       Optional. The hypernym.
       
      string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHypernym in interface SearchHypernymOrBuilder
      Returns:
      The hypernym.
    • getHypernymBytes

      public com.google.protobuf.ByteString getHypernymBytes()
       Optional. The hypernym.
       
      string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHypernymBytes in interface SearchHypernymOrBuilder
      Returns:
      The bytes for hypernym.
    • setHypernym

      public SearchHypernym.Builder setHypernym(String value)
       Optional. The hypernym.
       
      string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The hypernym to set.
      Returns:
      This builder for chaining.
    • clearHypernym

      public SearchHypernym.Builder clearHypernym()
       Optional. The hypernym.
       
      string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setHypernymBytes

      public SearchHypernym.Builder setHypernymBytes(com.google.protobuf.ByteString value)
       Optional. The hypernym.
       
      string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for hypernym to set.
      Returns:
      This builder for chaining.
    • getHyponymsList

      public com.google.protobuf.ProtocolStringList getHyponymsList()
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHyponymsList in interface SearchHypernymOrBuilder
      Returns:
      A list containing the hyponyms.
    • getHyponymsCount

      public int getHyponymsCount()
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHyponymsCount in interface SearchHypernymOrBuilder
      Returns:
      The count of hyponyms.
    • getHyponyms

      public String getHyponyms(int index)
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHyponyms in interface SearchHypernymOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The hyponyms at the given index.
    • getHyponymsBytes

      public com.google.protobuf.ByteString getHyponymsBytes(int index)
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHyponymsBytes in interface SearchHypernymOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the hyponyms at the given index.
    • setHyponyms

      public SearchHypernym.Builder setHyponyms(int index, String value)
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      index - The index to set the value at.
      value - The hyponyms to set.
      Returns:
      This builder for chaining.
    • addHyponyms

      public SearchHypernym.Builder addHyponyms(String value)
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The hyponyms to add.
      Returns:
      This builder for chaining.
    • addAllHyponyms

      public SearchHypernym.Builder addAllHyponyms(Iterable<String> values)
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      values - The hyponyms to add.
      Returns:
      This builder for chaining.
    • clearHyponyms

      public SearchHypernym.Builder clearHyponyms()
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • addHyponymsBytes

      public SearchHypernym.Builder addHyponymsBytes(com.google.protobuf.ByteString value)
       Optional. Hyponyms that the hypernym is mapped to.
       
      repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes of the hyponyms to add.
      Returns:
      This builder for chaining.