io.pinecone.proto.QueryVector 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;
/**
*
* A single query vector within a `QueryRequest`.
*
*
* Protobuf type {@code QueryVector}
*/
public final class QueryVector extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:QueryVector)
QueryVectorOrBuilder {
private static final long serialVersionUID = 0L;
// Use QueryVector.newBuilder() to construct.
private QueryVector(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private QueryVector() {
values_ = emptyFloatList();
namespace_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new QueryVector();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryVector_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryVector_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.pinecone.proto.QueryVector.class, io.pinecone.proto.QueryVector.Builder.class);
}
private int bitField0_;
public static final int VALUES_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.FloatList values_ =
emptyFloatList();
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @return A list containing the values.
*/
@java.lang.Override
public java.util.List
getValuesList() {
return values_;
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @return The count of values.
*/
public int getValuesCount() {
return values_.size();
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @param index The index of the element to return.
* @return The values at the given index.
*/
public float getValues(int index) {
return values_.getFloat(index);
}
private int valuesMemoizedSerializedSize = -1;
public static final int SPARSE_VALUES_FIELD_NUMBER = 5;
private io.pinecone.proto.SparseValues sparseValues_;
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
* @return Whether the sparseValues field is set.
*/
@java.lang.Override
public boolean hasSparseValues() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
* @return The sparseValues.
*/
@java.lang.Override
public io.pinecone.proto.SparseValues getSparseValues() {
return sparseValues_ == null ? io.pinecone.proto.SparseValues.getDefaultInstance() : sparseValues_;
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
@java.lang.Override
public io.pinecone.proto.SparseValuesOrBuilder getSparseValuesOrBuilder() {
return sparseValues_ == null ? io.pinecone.proto.SparseValues.getDefaultInstance() : sparseValues_;
}
public static final int TOP_K_FIELD_NUMBER = 2;
private int topK_ = 0;
/**
*
* An override for the number of results to return for this query vector.
*
*
* uint32 top_k = 2;
* @return The topK.
*/
@java.lang.Override
public int getTopK() {
return topK_;
}
public static final int NAMESPACE_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object namespace_ = "";
/**
*
* An override the namespace to search.
*
*
* 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;
}
}
/**
*
* An override the namespace to search.
*
*
* 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 FILTER_FIELD_NUMBER = 4;
private com.google.protobuf.Struct filter_;
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
* @return Whether the filter field is set.
*/
@java.lang.Override
public boolean hasFilter() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
* @return The filter.
*/
@java.lang.Override
public com.google.protobuf.Struct getFilter() {
return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_;
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
@java.lang.Override
public com.google.protobuf.StructOrBuilder getFilterOrBuilder() {
return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_;
}
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 {
getSerializedSize();
if (getValuesList().size() > 0) {
output.writeUInt32NoTag(10);
output.writeUInt32NoTag(valuesMemoizedSerializedSize);
}
for (int i = 0; i < values_.size(); i++) {
output.writeFloatNoTag(values_.getFloat(i));
}
if (topK_ != 0) {
output.writeUInt32(2, topK_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, namespace_);
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(4, getFilter());
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(5, getSparseValues());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
dataSize = 4 * getValuesList().size();
size += dataSize;
if (!getValuesList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
valuesMemoizedSerializedSize = dataSize;
}
if (topK_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, topK_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, namespace_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getFilter());
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, getSparseValues());
}
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.QueryVector)) {
return super.equals(obj);
}
io.pinecone.proto.QueryVector other = (io.pinecone.proto.QueryVector) obj;
if (!getValuesList()
.equals(other.getValuesList())) return false;
if (hasSparseValues() != other.hasSparseValues()) return false;
if (hasSparseValues()) {
if (!getSparseValues()
.equals(other.getSparseValues())) return false;
}
if (getTopK()
!= other.getTopK()) return false;
if (!getNamespace()
.equals(other.getNamespace())) return false;
if (hasFilter() != other.hasFilter()) return false;
if (hasFilter()) {
if (!getFilter()
.equals(other.getFilter())) 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 (getValuesCount() > 0) {
hash = (37 * hash) + VALUES_FIELD_NUMBER;
hash = (53 * hash) + getValuesList().hashCode();
}
if (hasSparseValues()) {
hash = (37 * hash) + SPARSE_VALUES_FIELD_NUMBER;
hash = (53 * hash) + getSparseValues().hashCode();
}
hash = (37 * hash) + TOP_K_FIELD_NUMBER;
hash = (53 * hash) + getTopK();
hash = (37 * hash) + NAMESPACE_FIELD_NUMBER;
hash = (53 * hash) + getNamespace().hashCode();
if (hasFilter()) {
hash = (37 * hash) + FILTER_FIELD_NUMBER;
hash = (53 * hash) + getFilter().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.pinecone.proto.QueryVector parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.pinecone.proto.QueryVector 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.QueryVector parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.pinecone.proto.QueryVector 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.QueryVector parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.pinecone.proto.QueryVector parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.pinecone.proto.QueryVector parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.pinecone.proto.QueryVector 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.QueryVector parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.pinecone.proto.QueryVector 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.QueryVector parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.pinecone.proto.QueryVector 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.QueryVector 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;
}
/**
*
* A single query vector within a `QueryRequest`.
*
*
* Protobuf type {@code QueryVector}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:QueryVector)
io.pinecone.proto.QueryVectorOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryVector_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryVector_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.pinecone.proto.QueryVector.class, io.pinecone.proto.QueryVector.Builder.class);
}
// Construct using io.pinecone.proto.QueryVector.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getSparseValuesFieldBuilder();
getFilterFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
values_ = emptyFloatList();
sparseValues_ = null;
if (sparseValuesBuilder_ != null) {
sparseValuesBuilder_.dispose();
sparseValuesBuilder_ = null;
}
topK_ = 0;
namespace_ = "";
filter_ = null;
if (filterBuilder_ != null) {
filterBuilder_.dispose();
filterBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.pinecone.proto.VectorServiceOuterClass.internal_static_QueryVector_descriptor;
}
@java.lang.Override
public io.pinecone.proto.QueryVector getDefaultInstanceForType() {
return io.pinecone.proto.QueryVector.getDefaultInstance();
}
@java.lang.Override
public io.pinecone.proto.QueryVector build() {
io.pinecone.proto.QueryVector result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.pinecone.proto.QueryVector buildPartial() {
io.pinecone.proto.QueryVector result = new io.pinecone.proto.QueryVector(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(io.pinecone.proto.QueryVector result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
values_.makeImmutable();
result.values_ = values_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.sparseValues_ = sparseValuesBuilder_ == null
? sparseValues_
: sparseValuesBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.topK_ = topK_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.namespace_ = namespace_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.filter_ = filterBuilder_ == null
? filter_
: filterBuilder_.build();
to_bitField0_ |= 0x00000002;
}
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.QueryVector) {
return mergeFrom((io.pinecone.proto.QueryVector)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.pinecone.proto.QueryVector other) {
if (other == io.pinecone.proto.QueryVector.getDefaultInstance()) return this;
if (!other.values_.isEmpty()) {
if (values_.isEmpty()) {
values_ = other.values_;
values_.makeImmutable();
bitField0_ |= 0x00000001;
} else {
ensureValuesIsMutable();
values_.addAll(other.values_);
}
onChanged();
}
if (other.hasSparseValues()) {
mergeSparseValues(other.getSparseValues());
}
if (other.getTopK() != 0) {
setTopK(other.getTopK());
}
if (!other.getNamespace().isEmpty()) {
namespace_ = other.namespace_;
bitField0_ |= 0x00000008;
onChanged();
}
if (other.hasFilter()) {
mergeFilter(other.getFilter());
}
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 13: {
float v = input.readFloat();
ensureValuesIsMutable();
values_.addFloat(v);
break;
} // case 13
case 10: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
int alloc = length > 4096 ? 4096 : length;
ensureValuesIsMutable(alloc / 4);
while (input.getBytesUntilLimit() > 0) {
values_.addFloat(input.readFloat());
}
input.popLimit(limit);
break;
} // case 10
case 16: {
topK_ = input.readUInt32();
bitField0_ |= 0x00000004;
break;
} // case 16
case 26: {
namespace_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 26
case 34: {
input.readMessage(
getFilterFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000010;
break;
} // case 34
case 42: {
input.readMessage(
getSparseValuesFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 42
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 com.google.protobuf.Internal.FloatList values_ = emptyFloatList();
private void ensureValuesIsMutable() {
if (!values_.isModifiable()) {
values_ = makeMutableCopy(values_);
}
bitField0_ |= 0x00000001;
}
private void ensureValuesIsMutable(int capacity) {
if (!values_.isModifiable()) {
values_ = makeMutableCopy(values_, capacity);
}
bitField0_ |= 0x00000001;
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @return A list containing the values.
*/
public java.util.List
getValuesList() {
values_.makeImmutable();
return values_;
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @return The count of values.
*/
public int getValuesCount() {
return values_.size();
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @param index The index of the element to return.
* @return The values at the given index.
*/
public float getValues(int index) {
return values_.getFloat(index);
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @param index The index to set the value at.
* @param value The values to set.
* @return This builder for chaining.
*/
public Builder setValues(
int index, float value) {
ensureValuesIsMutable();
values_.setFloat(index, value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @param value The values to add.
* @return This builder for chaining.
*/
public Builder addValues(float value) {
ensureValuesIsMutable();
values_.addFloat(value);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @param values The values to add.
* @return This builder for chaining.
*/
public Builder addAllValues(
java.lang.Iterable extends java.lang.Float> values) {
ensureValuesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, values_);
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The query vector values. This should be the same length as the dimension of the index being queried.
*
*
* repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];
* @return This builder for chaining.
*/
public Builder clearValues() {
values_ = emptyFloatList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
private io.pinecone.proto.SparseValues sparseValues_;
private com.google.protobuf.SingleFieldBuilderV3<
io.pinecone.proto.SparseValues, io.pinecone.proto.SparseValues.Builder, io.pinecone.proto.SparseValuesOrBuilder> sparseValuesBuilder_;
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
* @return Whether the sparseValues field is set.
*/
public boolean hasSparseValues() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
* @return The sparseValues.
*/
public io.pinecone.proto.SparseValues getSparseValues() {
if (sparseValuesBuilder_ == null) {
return sparseValues_ == null ? io.pinecone.proto.SparseValues.getDefaultInstance() : sparseValues_;
} else {
return sparseValuesBuilder_.getMessage();
}
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
public Builder setSparseValues(io.pinecone.proto.SparseValues value) {
if (sparseValuesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
sparseValues_ = value;
} else {
sparseValuesBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
public Builder setSparseValues(
io.pinecone.proto.SparseValues.Builder builderForValue) {
if (sparseValuesBuilder_ == null) {
sparseValues_ = builderForValue.build();
} else {
sparseValuesBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
public Builder mergeSparseValues(io.pinecone.proto.SparseValues value) {
if (sparseValuesBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
sparseValues_ != null &&
sparseValues_ != io.pinecone.proto.SparseValues.getDefaultInstance()) {
getSparseValuesBuilder().mergeFrom(value);
} else {
sparseValues_ = value;
}
} else {
sparseValuesBuilder_.mergeFrom(value);
}
if (sparseValues_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
public Builder clearSparseValues() {
bitField0_ = (bitField0_ & ~0x00000002);
sparseValues_ = null;
if (sparseValuesBuilder_ != null) {
sparseValuesBuilder_.dispose();
sparseValuesBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
public io.pinecone.proto.SparseValues.Builder getSparseValuesBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getSparseValuesFieldBuilder().getBuilder();
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
public io.pinecone.proto.SparseValuesOrBuilder getSparseValuesOrBuilder() {
if (sparseValuesBuilder_ != null) {
return sparseValuesBuilder_.getMessageOrBuilder();
} else {
return sparseValues_ == null ?
io.pinecone.proto.SparseValues.getDefaultInstance() : sparseValues_;
}
}
/**
*
* The query sparse values.
*
*
* .SparseValues sparse_values = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.pinecone.proto.SparseValues, io.pinecone.proto.SparseValues.Builder, io.pinecone.proto.SparseValuesOrBuilder>
getSparseValuesFieldBuilder() {
if (sparseValuesBuilder_ == null) {
sparseValuesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.pinecone.proto.SparseValues, io.pinecone.proto.SparseValues.Builder, io.pinecone.proto.SparseValuesOrBuilder>(
getSparseValues(),
getParentForChildren(),
isClean());
sparseValues_ = null;
}
return sparseValuesBuilder_;
}
private int topK_ ;
/**
*
* An override for the number of results to return for this query vector.
*
*
* uint32 top_k = 2;
* @return The topK.
*/
@java.lang.Override
public int getTopK() {
return topK_;
}
/**
*
* An override for the number of results to return for this query vector.
*
*
* uint32 top_k = 2;
* @param value The topK to set.
* @return This builder for chaining.
*/
public Builder setTopK(int value) {
topK_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* An override for the number of results to return for this query vector.
*
*
* uint32 top_k = 2;
* @return This builder for chaining.
*/
public Builder clearTopK() {
bitField0_ = (bitField0_ & ~0x00000004);
topK_ = 0;
onChanged();
return this;
}
private java.lang.Object namespace_ = "";
/**
*
* An override the namespace to search.
*
*
* 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;
}
}
/**
*
* An override the namespace to search.
*
*
* 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;
}
}
/**
*
* An override the namespace to search.
*
*
* 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_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* An override the namespace to search.
*
*
* string namespace = 3;
* @return This builder for chaining.
*/
public Builder clearNamespace() {
namespace_ = getDefaultInstance().getNamespace();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
* An override the namespace to search.
*
*
* 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_ |= 0x00000008;
onChanged();
return this;
}
private com.google.protobuf.Struct filter_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> filterBuilder_;
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
* @return Whether the filter field is set.
*/
public boolean hasFilter() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
* @return The filter.
*/
public com.google.protobuf.Struct getFilter() {
if (filterBuilder_ == null) {
return filter_ == null ? com.google.protobuf.Struct.getDefaultInstance() : filter_;
} else {
return filterBuilder_.getMessage();
}
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
public Builder setFilter(com.google.protobuf.Struct value) {
if (filterBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
filter_ = value;
} else {
filterBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
public Builder setFilter(
com.google.protobuf.Struct.Builder builderForValue) {
if (filterBuilder_ == null) {
filter_ = builderForValue.build();
} else {
filterBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
public Builder mergeFilter(com.google.protobuf.Struct value) {
if (filterBuilder_ == null) {
if (((bitField0_ & 0x00000010) != 0) &&
filter_ != null &&
filter_ != com.google.protobuf.Struct.getDefaultInstance()) {
getFilterBuilder().mergeFrom(value);
} else {
filter_ = value;
}
} else {
filterBuilder_.mergeFrom(value);
}
if (filter_ != null) {
bitField0_ |= 0x00000010;
onChanged();
}
return this;
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
public Builder clearFilter() {
bitField0_ = (bitField0_ & ~0x00000010);
filter_ = null;
if (filterBuilder_ != null) {
filterBuilder_.dispose();
filterBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
public com.google.protobuf.Struct.Builder getFilterBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getFilterFieldBuilder().getBuilder();
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
public com.google.protobuf.StructOrBuilder getFilterOrBuilder() {
if (filterBuilder_ != null) {
return filterBuilder_.getMessageOrBuilder();
} else {
return filter_ == null ?
com.google.protobuf.Struct.getDefaultInstance() : filter_;
}
}
/**
*
* An override for the metadata filter to apply. This replaces the request-level filter.
*
*
* .google.protobuf.Struct filter = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>
getFilterFieldBuilder() {
if (filterBuilder_ == null) {
filterBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
getFilter(),
getParentForChildren(),
isClean());
filter_ = null;
}
return filterBuilder_;
}
@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:QueryVector)
}
// @@protoc_insertion_point(class_scope:QueryVector)
private static final io.pinecone.proto.QueryVector DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.pinecone.proto.QueryVector();
}
public static io.pinecone.proto.QueryVector getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public QueryVector 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.QueryVector getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}