Send feedback
  
   
 
  
    
      Class FindNeighborsResponse.NearestNeighbors.Builder (3.77.0) 
  
  
  
   
  
    
  
  
    
    
    
    
    
  Version latestkeyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   static   final   class  FindNeighborsResponse . NearestNeighbors . Builder   extends   GeneratedMessageV3 . Builder<FindNeighborsResponse . NearestNeighbors . Builder >  implements   FindNeighborsResponse . NearestNeighborsOrBuilder  
   Nearest neighbors for one query.
 Protobuf type google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors
    Inherited Members 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder() 
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int) 
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int) 
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString) 
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int) 
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int) 
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder) 
    
    
    
    
    
    
    
    
    
    
    
    
   
  Static Methods
   
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
  
  Methods
   
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   addAllNeighbors ( Iterable <?   extends   FindNeighborsResponse . Neighbor >  values )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Parameter  
      
        Name Description  
      
        valuesIterable <? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor > 
     
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   addNeighbors ( FindNeighborsResponse . Neighbor   value )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NearestNeighbors . Builder   addNeighbors ( FindNeighborsResponse . Neighbor . Builder   builderForValue )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NearestNeighbors . Builder   addNeighbors ( int   index ,   FindNeighborsResponse . Neighbor   value )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NearestNeighbors . Builder   addNeighbors ( int   index ,   FindNeighborsResponse . Neighbor . Builder   builderForValue )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . Neighbor . Builder   addNeighborsBuilder ()  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . Neighbor . Builder   addNeighborsBuilder ( int   index )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   addRepeatedField ( Descriptors . FieldDescriptor   field ,   Object   value )  
  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors   build ()  
  
  
    
public   FindNeighborsResponse . NearestNeighbors   buildPartial ()  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   clear ()  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   clearField ( Descriptors . FieldDescriptor   field )  
  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   clearId ()  
   The ID of the query datapoint.
 string id = 1;
    
public   FindNeighborsResponse . NearestNeighbors . Builder   clearNeighbors ()  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NearestNeighbors . Builder   clearOneof ( Descriptors . OneofDescriptor   oneof )  
  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   clone ()  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors   getDefaultInstanceForType ()  
  
  
    
public   Descriptors . Descriptor   getDescriptorForType ()  
  
  Overrides 
  
   The ID of the query datapoint.
 string id = 1;
    
      
        Returns  
      
        Type Description  
      
        String The id.
 
     
  
  
    
public   ByteString   getIdBytes ()  
   The ID of the query datapoint.
 string id = 1;
    
      
        Returns  
      
        Type Description  
      
        ByteString The bytes for id.
 
     
  
  
    
public   FindNeighborsResponse . Neighbor   getNeighbors ( int   index )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  
    
public   FindNeighborsResponse . Neighbor . Builder   getNeighborsBuilder ( int   index )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  
    
public   List<FindNeighborsResponse . Neighbor . Builder >  getNeighborsBuilderList ()  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   int   getNeighborsCount ()  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  
    
public   List<FindNeighborsResponse . Neighbor >  getNeighborsList ()  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NeighborOrBuilder   getNeighborsOrBuilder ( int   index )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  
    
public   List <?   extends   FindNeighborsResponse . NeighborOrBuilder >  getNeighborsOrBuilderList ()  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Returns  
      
        Type Description  
      
        List <? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder > 
     
  
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
  
  Overrides 
  
  
    
public   final   boolean   isInitialized ()  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   mergeFrom ( FindNeighborsResponse . NearestNeighbors   other )  
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   mergeFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  Overrides 
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   mergeFrom ( Message   other )  
  
    
      
        Parameter  
      
        Name Description  
      
        otherMessage  
     
  
  
  Overrides 
  
  
    
public   final   FindNeighborsResponse . NearestNeighbors . Builder   mergeUnknownFields ( UnknownFieldSet   unknownFields )  
  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   removeNeighbors ( int   index )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
      
        Parameter  
      
        Name Description  
      
        indexint  
     
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   setField ( Descriptors . FieldDescriptor   field ,   Object   value )  
  
  
  Overrides 
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   setId ( String   value )  
   The ID of the query datapoint.
 string id = 1;
    
      
        Parameter  
      
        Name Description  
      
        valueString The id to set.
 
     
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   setIdBytes ( ByteString   value )  
   The ID of the query datapoint.
 string id = 1;
    
      
        Parameter  
      
        Name Description  
      
        valueByteString The bytes for id to set.
 
     
  
  
  
    
public   FindNeighborsResponse . NearestNeighbors . Builder   setNeighbors ( int   index ,   FindNeighborsResponse . Neighbor   value )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NearestNeighbors . Builder   setNeighbors ( int   index ,   FindNeighborsResponse . Neighbor . Builder   builderForValue )  
   All its neighbors.
 repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2;
 
    
public   FindNeighborsResponse . NearestNeighbors . Builder   setRepeatedField ( Descriptors . FieldDescriptor   field ,   int   index ,   Object   value )  
  
  
  Overrides 
  
  
    
public   final   FindNeighborsResponse . NearestNeighbors . Builder   setUnknownFields ( UnknownFieldSet   unknownFields )  
  
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    Send feedback
  
   
 
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-11 UTC.
 
 
  
  
    
    
    
      
  
  
    Need to tell us more?
  
   
 
     
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]