io.pinecone.proto.QueryResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pinecone-client Show documentation
Show all versions of pinecone-client Show documentation
The Pinecone.io Java Client
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: vector_service.proto
// Protobuf Java Version: 3.25.3
package io.pinecone.proto;
/**
*
* The response for the `query` operation. These are the matches found for a particular query vector. The matches are ordered from most similar to least similar.
*
*
* Protobuf type {@code QueryResponse}
*/
public final class QueryResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:QueryResponse)
QueryResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use QueryResponse.newBuilder() to construct.
private QueryResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private QueryResponse() {
results_ = java.util.Collections.emptyList();
matches_ = java.util.Collections.emptyList();
namespace_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new QueryResponse();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.pinecone.proto.QueryResponse.class, io.pinecone.proto.QueryResponse.Builder.class);
}
private int bitField0_;
public static final int RESULTS_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List results_;
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Override
@java.lang.Deprecated public java.util.List getResultsList() {
return results_;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Override
@java.lang.Deprecated public java.util.List extends io.pinecone.proto.SingleQueryResultsOrBuilder>
getResultsOrBuilderList() {
return results_;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Override
@java.lang.Deprecated public int getResultsCount() {
return results_.size();
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Override
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResults getResults(int index) {
return results_.get(index);
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Override
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResultsOrBuilder getResultsOrBuilder(
int index) {
return results_.get(index);
}
public static final int MATCHES_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List matches_;
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
@java.lang.Override
public java.util.List getMatchesList() {
return matches_;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
@java.lang.Override
public java.util.List extends io.pinecone.proto.ScoredVectorOrBuilder>
getMatchesOrBuilderList() {
return matches_;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
@java.lang.Override
public int getMatchesCount() {
return matches_.size();
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
@java.lang.Override
public io.pinecone.proto.ScoredVector getMatches(int index) {
return matches_.get(index);
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
@java.lang.Override
public io.pinecone.proto.ScoredVectorOrBuilder getMatchesOrBuilder(
int index) {
return matches_.get(index);
}
public static final int NAMESPACE_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object namespace_ = "";
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @return The namespace.
*/
@java.lang.Override
public java.lang.String getNamespace() {
java.lang.Object ref = namespace_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
namespace_ = s;
return s;
}
}
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @return The bytes for namespace.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNamespaceBytes() {
java.lang.Object ref = namespace_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
namespace_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int USAGE_FIELD_NUMBER = 4;
private io.pinecone.proto.Usage usage_;
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
* @return Whether the usage field is set.
*/
@java.lang.Override
public boolean hasUsage() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
* @return The usage.
*/
@java.lang.Override
public io.pinecone.proto.Usage getUsage() {
return usage_ == null ? io.pinecone.proto.Usage.getDefaultInstance() : usage_;
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
@java.lang.Override
public io.pinecone.proto.UsageOrBuilder getUsageOrBuilder() {
return usage_ == null ? io.pinecone.proto.Usage.getDefaultInstance() : usage_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < results_.size(); i++) {
output.writeMessage(1, results_.get(i));
}
for (int i = 0; i < matches_.size(); i++) {
output.writeMessage(2, matches_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, namespace_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(4, getUsage());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < results_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, results_.get(i));
}
for (int i = 0; i < matches_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, matches_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, namespace_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getUsage());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.pinecone.proto.QueryResponse)) {
return super.equals(obj);
}
io.pinecone.proto.QueryResponse other = (io.pinecone.proto.QueryResponse) obj;
if (!getResultsList()
.equals(other.getResultsList())) return false;
if (!getMatchesList()
.equals(other.getMatchesList())) return false;
if (!getNamespace()
.equals(other.getNamespace())) return false;
if (hasUsage() != other.hasUsage()) return false;
if (hasUsage()) {
if (!getUsage()
.equals(other.getUsage())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getResultsCount() > 0) {
hash = (37 * hash) + RESULTS_FIELD_NUMBER;
hash = (53 * hash) + getResultsList().hashCode();
}
if (getMatchesCount() > 0) {
hash = (37 * hash) + MATCHES_FIELD_NUMBER;
hash = (53 * hash) + getMatchesList().hashCode();
}
hash = (37 * hash) + NAMESPACE_FIELD_NUMBER;
hash = (53 * hash) + getNamespace().hashCode();
if (hasUsage()) {
hash = (37 * hash) + USAGE_FIELD_NUMBER;
hash = (53 * hash) + getUsage().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.pinecone.proto.QueryResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.pinecone.proto.QueryResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.pinecone.proto.QueryResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.pinecone.proto.QueryResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.pinecone.proto.QueryResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.pinecone.proto.QueryResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.pinecone.proto.QueryResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.pinecone.proto.QueryResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.pinecone.proto.QueryResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.pinecone.proto.QueryResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.pinecone.proto.QueryResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.pinecone.proto.QueryResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.pinecone.proto.QueryResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* The response for the `query` operation. These are the matches found for a particular query vector. The matches are ordered from most similar to least similar.
*
*
* Protobuf type {@code QueryResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:QueryResponse)
io.pinecone.proto.QueryResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.pinecone.proto.QueryResponse.class, io.pinecone.proto.QueryResponse.Builder.class);
}
// Construct using io.pinecone.proto.QueryResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getResultsFieldBuilder();
getMatchesFieldBuilder();
getUsageFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (resultsBuilder_ == null) {
results_ = java.util.Collections.emptyList();
} else {
results_ = null;
resultsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
if (matchesBuilder_ == null) {
matches_ = java.util.Collections.emptyList();
} else {
matches_ = null;
matchesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
namespace_ = "";
usage_ = null;
if (usageBuilder_ != null) {
usageBuilder_.dispose();
usageBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryResponse_descriptor;
}
@java.lang.Override
public io.pinecone.proto.QueryResponse getDefaultInstanceForType() {
return io.pinecone.proto.QueryResponse.getDefaultInstance();
}
@java.lang.Override
public io.pinecone.proto.QueryResponse build() {
io.pinecone.proto.QueryResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.pinecone.proto.QueryResponse buildPartial() {
io.pinecone.proto.QueryResponse result = new io.pinecone.proto.QueryResponse(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(io.pinecone.proto.QueryResponse result) {
if (resultsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
results_ = java.util.Collections.unmodifiableList(results_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.results_ = results_;
} else {
result.results_ = resultsBuilder_.build();
}
if (matchesBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
matches_ = java.util.Collections.unmodifiableList(matches_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.matches_ = matches_;
} else {
result.matches_ = matchesBuilder_.build();
}
}
private void buildPartial0(io.pinecone.proto.QueryResponse result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.namespace_ = namespace_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000008) != 0)) {
result.usage_ = usageBuilder_ == null
? usage_
: usageBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.pinecone.proto.QueryResponse) {
return mergeFrom((io.pinecone.proto.QueryResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.pinecone.proto.QueryResponse other) {
if (other == io.pinecone.proto.QueryResponse.getDefaultInstance()) return this;
if (resultsBuilder_ == null) {
if (!other.results_.isEmpty()) {
if (results_.isEmpty()) {
results_ = other.results_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureResultsIsMutable();
results_.addAll(other.results_);
}
onChanged();
}
} else {
if (!other.results_.isEmpty()) {
if (resultsBuilder_.isEmpty()) {
resultsBuilder_.dispose();
resultsBuilder_ = null;
results_ = other.results_;
bitField0_ = (bitField0_ & ~0x00000001);
resultsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getResultsFieldBuilder() : null;
} else {
resultsBuilder_.addAllMessages(other.results_);
}
}
}
if (matchesBuilder_ == null) {
if (!other.matches_.isEmpty()) {
if (matches_.isEmpty()) {
matches_ = other.matches_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureMatchesIsMutable();
matches_.addAll(other.matches_);
}
onChanged();
}
} else {
if (!other.matches_.isEmpty()) {
if (matchesBuilder_.isEmpty()) {
matchesBuilder_.dispose();
matchesBuilder_ = null;
matches_ = other.matches_;
bitField0_ = (bitField0_ & ~0x00000002);
matchesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getMatchesFieldBuilder() : null;
} else {
matchesBuilder_.addAllMessages(other.matches_);
}
}
}
if (!other.getNamespace().isEmpty()) {
namespace_ = other.namespace_;
bitField0_ |= 0x00000004;
onChanged();
}
if (other.hasUsage()) {
mergeUsage(other.getUsage());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
io.pinecone.proto.SingleQueryResults m =
input.readMessage(
io.pinecone.proto.SingleQueryResults.parser(),
extensionRegistry);
if (resultsBuilder_ == null) {
ensureResultsIsMutable();
results_.add(m);
} else {
resultsBuilder_.addMessage(m);
}
break;
} // case 10
case 18: {
io.pinecone.proto.ScoredVector m =
input.readMessage(
io.pinecone.proto.ScoredVector.parser(),
extensionRegistry);
if (matchesBuilder_ == null) {
ensureMatchesIsMutable();
matches_.add(m);
} else {
matchesBuilder_.addMessage(m);
}
break;
} // case 18
case 26: {
namespace_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
case 34: {
input.readMessage(
getUsageFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.util.List results_ =
java.util.Collections.emptyList();
private void ensureResultsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
results_ = new java.util.ArrayList(results_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.pinecone.proto.SingleQueryResults, io.pinecone.proto.SingleQueryResults.Builder, io.pinecone.proto.SingleQueryResultsOrBuilder> resultsBuilder_;
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public java.util.List getResultsList() {
if (resultsBuilder_ == null) {
return java.util.Collections.unmodifiableList(results_);
} else {
return resultsBuilder_.getMessageList();
}
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public int getResultsCount() {
if (resultsBuilder_ == null) {
return results_.size();
} else {
return resultsBuilder_.getCount();
}
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResults getResults(int index) {
if (resultsBuilder_ == null) {
return results_.get(index);
} else {
return resultsBuilder_.getMessage(index);
}
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder setResults(
int index, io.pinecone.proto.SingleQueryResults value) {
if (resultsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureResultsIsMutable();
results_.set(index, value);
onChanged();
} else {
resultsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder setResults(
int index, io.pinecone.proto.SingleQueryResults.Builder builderForValue) {
if (resultsBuilder_ == null) {
ensureResultsIsMutable();
results_.set(index, builderForValue.build());
onChanged();
} else {
resultsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder addResults(io.pinecone.proto.SingleQueryResults value) {
if (resultsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureResultsIsMutable();
results_.add(value);
onChanged();
} else {
resultsBuilder_.addMessage(value);
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder addResults(
int index, io.pinecone.proto.SingleQueryResults value) {
if (resultsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureResultsIsMutable();
results_.add(index, value);
onChanged();
} else {
resultsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder addResults(
io.pinecone.proto.SingleQueryResults.Builder builderForValue) {
if (resultsBuilder_ == null) {
ensureResultsIsMutable();
results_.add(builderForValue.build());
onChanged();
} else {
resultsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder addResults(
int index, io.pinecone.proto.SingleQueryResults.Builder builderForValue) {
if (resultsBuilder_ == null) {
ensureResultsIsMutable();
results_.add(index, builderForValue.build());
onChanged();
} else {
resultsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder addAllResults(
java.lang.Iterable extends io.pinecone.proto.SingleQueryResults> values) {
if (resultsBuilder_ == null) {
ensureResultsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, results_);
onChanged();
} else {
resultsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder clearResults() {
if (resultsBuilder_ == null) {
results_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
resultsBuilder_.clear();
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public Builder removeResults(int index) {
if (resultsBuilder_ == null) {
ensureResultsIsMutable();
results_.remove(index);
onChanged();
} else {
resultsBuilder_.remove(index);
}
return this;
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResults.Builder getResultsBuilder(
int index) {
return getResultsFieldBuilder().getBuilder(index);
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResultsOrBuilder getResultsOrBuilder(
int index) {
if (resultsBuilder_ == null) {
return results_.get(index); } else {
return resultsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public java.util.List extends io.pinecone.proto.SingleQueryResultsOrBuilder>
getResultsOrBuilderList() {
if (resultsBuilder_ != null) {
return resultsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(results_);
}
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResults.Builder addResultsBuilder() {
return getResultsFieldBuilder().addBuilder(
io.pinecone.proto.SingleQueryResults.getDefaultInstance());
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public io.pinecone.proto.SingleQueryResults.Builder addResultsBuilder(
int index) {
return getResultsFieldBuilder().addBuilder(
index, io.pinecone.proto.SingleQueryResults.getDefaultInstance());
}
/**
*
* DEPRECATED. The results of each query. The order is the same as `QueryRequest.queries`.
*
*
* repeated .SingleQueryResults results = 1 [deprecated = true];
*/
@java.lang.Deprecated public java.util.List
getResultsBuilderList() {
return getResultsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.pinecone.proto.SingleQueryResults, io.pinecone.proto.SingleQueryResults.Builder, io.pinecone.proto.SingleQueryResultsOrBuilder>
getResultsFieldBuilder() {
if (resultsBuilder_ == null) {
resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.pinecone.proto.SingleQueryResults, io.pinecone.proto.SingleQueryResults.Builder, io.pinecone.proto.SingleQueryResultsOrBuilder>(
results_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
results_ = null;
}
return resultsBuilder_;
}
private java.util.List matches_ =
java.util.Collections.emptyList();
private void ensureMatchesIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
matches_ = new java.util.ArrayList(matches_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.pinecone.proto.ScoredVector, io.pinecone.proto.ScoredVector.Builder, io.pinecone.proto.ScoredVectorOrBuilder> matchesBuilder_;
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public java.util.List getMatchesList() {
if (matchesBuilder_ == null) {
return java.util.Collections.unmodifiableList(matches_);
} else {
return matchesBuilder_.getMessageList();
}
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public int getMatchesCount() {
if (matchesBuilder_ == null) {
return matches_.size();
} else {
return matchesBuilder_.getCount();
}
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public io.pinecone.proto.ScoredVector getMatches(int index) {
if (matchesBuilder_ == null) {
return matches_.get(index);
} else {
return matchesBuilder_.getMessage(index);
}
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder setMatches(
int index, io.pinecone.proto.ScoredVector value) {
if (matchesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMatchesIsMutable();
matches_.set(index, value);
onChanged();
} else {
matchesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder setMatches(
int index, io.pinecone.proto.ScoredVector.Builder builderForValue) {
if (matchesBuilder_ == null) {
ensureMatchesIsMutable();
matches_.set(index, builderForValue.build());
onChanged();
} else {
matchesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder addMatches(io.pinecone.proto.ScoredVector value) {
if (matchesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMatchesIsMutable();
matches_.add(value);
onChanged();
} else {
matchesBuilder_.addMessage(value);
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder addMatches(
int index, io.pinecone.proto.ScoredVector value) {
if (matchesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMatchesIsMutable();
matches_.add(index, value);
onChanged();
} else {
matchesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder addMatches(
io.pinecone.proto.ScoredVector.Builder builderForValue) {
if (matchesBuilder_ == null) {
ensureMatchesIsMutable();
matches_.add(builderForValue.build());
onChanged();
} else {
matchesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder addMatches(
int index, io.pinecone.proto.ScoredVector.Builder builderForValue) {
if (matchesBuilder_ == null) {
ensureMatchesIsMutable();
matches_.add(index, builderForValue.build());
onChanged();
} else {
matchesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder addAllMatches(
java.lang.Iterable extends io.pinecone.proto.ScoredVector> values) {
if (matchesBuilder_ == null) {
ensureMatchesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, matches_);
onChanged();
} else {
matchesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder clearMatches() {
if (matchesBuilder_ == null) {
matches_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
matchesBuilder_.clear();
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public Builder removeMatches(int index) {
if (matchesBuilder_ == null) {
ensureMatchesIsMutable();
matches_.remove(index);
onChanged();
} else {
matchesBuilder_.remove(index);
}
return this;
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public io.pinecone.proto.ScoredVector.Builder getMatchesBuilder(
int index) {
return getMatchesFieldBuilder().getBuilder(index);
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public io.pinecone.proto.ScoredVectorOrBuilder getMatchesOrBuilder(
int index) {
if (matchesBuilder_ == null) {
return matches_.get(index); } else {
return matchesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public java.util.List extends io.pinecone.proto.ScoredVectorOrBuilder>
getMatchesOrBuilderList() {
if (matchesBuilder_ != null) {
return matchesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(matches_);
}
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public io.pinecone.proto.ScoredVector.Builder addMatchesBuilder() {
return getMatchesFieldBuilder().addBuilder(
io.pinecone.proto.ScoredVector.getDefaultInstance());
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public io.pinecone.proto.ScoredVector.Builder addMatchesBuilder(
int index) {
return getMatchesFieldBuilder().addBuilder(
index, io.pinecone.proto.ScoredVector.getDefaultInstance());
}
/**
*
* The matches for the vectors.
*
*
* repeated .ScoredVector matches = 2;
*/
public java.util.List
getMatchesBuilderList() {
return getMatchesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.pinecone.proto.ScoredVector, io.pinecone.proto.ScoredVector.Builder, io.pinecone.proto.ScoredVectorOrBuilder>
getMatchesFieldBuilder() {
if (matchesBuilder_ == null) {
matchesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.pinecone.proto.ScoredVector, io.pinecone.proto.ScoredVector.Builder, io.pinecone.proto.ScoredVectorOrBuilder>(
matches_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
matches_ = null;
}
return matchesBuilder_;
}
private java.lang.Object namespace_ = "";
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @return The namespace.
*/
public java.lang.String getNamespace() {
java.lang.Object ref = namespace_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
namespace_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @return The bytes for namespace.
*/
public com.google.protobuf.ByteString
getNamespaceBytes() {
java.lang.Object ref = namespace_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
namespace_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @param value The namespace to set.
* @return This builder for chaining.
*/
public Builder setNamespace(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
namespace_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @return This builder for chaining.
*/
public Builder clearNamespace() {
namespace_ = getDefaultInstance().getNamespace();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
* The namespace for the vectors.
*
*
* string namespace = 3;
* @param value The bytes for namespace to set.
* @return This builder for chaining.
*/
public Builder setNamespaceBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
namespace_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private io.pinecone.proto.Usage usage_;
private com.google.protobuf.SingleFieldBuilderV3<
io.pinecone.proto.Usage, io.pinecone.proto.Usage.Builder, io.pinecone.proto.UsageOrBuilder> usageBuilder_;
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
* @return Whether the usage field is set.
*/
public boolean hasUsage() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
* @return The usage.
*/
public io.pinecone.proto.Usage getUsage() {
if (usageBuilder_ == null) {
return usage_ == null ? io.pinecone.proto.Usage.getDefaultInstance() : usage_;
} else {
return usageBuilder_.getMessage();
}
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
public Builder setUsage(io.pinecone.proto.Usage value) {
if (usageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
usage_ = value;
} else {
usageBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
public Builder setUsage(
io.pinecone.proto.Usage.Builder builderForValue) {
if (usageBuilder_ == null) {
usage_ = builderForValue.build();
} else {
usageBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
public Builder mergeUsage(io.pinecone.proto.Usage value) {
if (usageBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0) &&
usage_ != null &&
usage_ != io.pinecone.proto.Usage.getDefaultInstance()) {
getUsageBuilder().mergeFrom(value);
} else {
usage_ = value;
}
} else {
usageBuilder_.mergeFrom(value);
}
if (usage_ != null) {
bitField0_ |= 0x00000008;
onChanged();
}
return this;
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
public Builder clearUsage() {
bitField0_ = (bitField0_ & ~0x00000008);
usage_ = null;
if (usageBuilder_ != null) {
usageBuilder_.dispose();
usageBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
public io.pinecone.proto.Usage.Builder getUsageBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getUsageFieldBuilder().getBuilder();
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
public io.pinecone.proto.UsageOrBuilder getUsageOrBuilder() {
if (usageBuilder_ != null) {
return usageBuilder_.getMessageOrBuilder();
} else {
return usage_ == null ?
io.pinecone.proto.Usage.getDefaultInstance() : usage_;
}
}
/**
*
* The usage for this operation.
*
*
* optional .Usage usage = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.pinecone.proto.Usage, io.pinecone.proto.Usage.Builder, io.pinecone.proto.UsageOrBuilder>
getUsageFieldBuilder() {
if (usageBuilder_ == null) {
usageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.pinecone.proto.Usage, io.pinecone.proto.Usage.Builder, io.pinecone.proto.UsageOrBuilder>(
getUsage(),
getParentForChildren(),
isClean());
usage_ = null;
}
return usageBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:QueryResponse)
}
// @@protoc_insertion_point(class_scope:QueryResponse)
private static final io.pinecone.proto.QueryResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.pinecone.proto.QueryResponse();
}
public static io.pinecone.proto.QueryResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public QueryResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.pinecone.proto.QueryResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}