com.aerospike.vector.client.proto.IndexDefinition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of avs-client-java Show documentation
Show all versions of avs-client-java Show documentation
This project includes the Java client for Aerospike Vector Search for high-performance data interactions.
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: types.proto
// Protobuf Java Version: 3.25.5
package com.aerospike.vector.client.proto;
/**
*
* An index definition.
*
*
* Protobuf type {@code aerospike.vector.IndexDefinition}
*/
public final class IndexDefinition extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:aerospike.vector.IndexDefinition)
IndexDefinitionOrBuilder {
private static final long serialVersionUID = 0L;
// Use IndexDefinition.newBuilder() to construct.
private IndexDefinition(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private IndexDefinition() {
type_ = 0;
vectorDistanceMetric_ = 0;
field_ = "";
setFilter_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new IndexDefinition();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.aerospike.vector.client.proto.Types.internal_static_aerospike_vector_IndexDefinition_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 8:
return internalGetLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.aerospike.vector.client.proto.Types.internal_static_aerospike_vector_IndexDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.aerospike.vector.client.proto.IndexDefinition.class, com.aerospike.vector.client.proto.IndexDefinition.Builder.class);
}
private int bitField0_;
private int paramsCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object params_;
public enum ParamsCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
HNSWPARAMS(7),
PARAMS_NOT_SET(0);
private final int value;
private ParamsCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ParamsCase valueOf(int value) {
return forNumber(value);
}
public static ParamsCase forNumber(int value) {
switch (value) {
case 7: return HNSWPARAMS;
case 0: return PARAMS_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public ParamsCase
getParamsCase() {
return ParamsCase.forNumber(
paramsCase_);
}
public static final int ID_FIELD_NUMBER = 1;
private com.aerospike.vector.client.proto.IndexId id_;
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
* @return Whether the id field is set.
*/
@java.lang.Override
public boolean hasId() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
* @return The id.
*/
@java.lang.Override
public com.aerospike.vector.client.proto.IndexId getId() {
return id_ == null ? com.aerospike.vector.client.proto.IndexId.getDefaultInstance() : id_;
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
@java.lang.Override
public com.aerospike.vector.client.proto.IndexIdOrBuilder getIdOrBuilder() {
return id_ == null ? com.aerospike.vector.client.proto.IndexId.getDefaultInstance() : id_;
}
public static final int TYPE_FIELD_NUMBER = 2;
private int type_ = 0;
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return Whether the type field is set.
*/
@java.lang.Override public boolean hasType() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override public int getTypeValue() {
return type_;
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return The type.
*/
@java.lang.Override public com.aerospike.vector.client.proto.IndexType getType() {
com.aerospike.vector.client.proto.IndexType result = com.aerospike.vector.client.proto.IndexType.forNumber(type_);
return result == null ? com.aerospike.vector.client.proto.IndexType.UNRECOGNIZED : result;
}
public static final int DIMENSIONS_FIELD_NUMBER = 3;
private int dimensions_ = 0;
/**
*
* Number of dimensions in data.
* Vectors not matching the dimension count will not be indexed.
*
*
* uint32 dimensions = 3;
* @return The dimensions.
*/
@java.lang.Override
public int getDimensions() {
return dimensions_;
}
public static final int VECTORDISTANCEMETRIC_FIELD_NUMBER = 4;
private int vectorDistanceMetric_ = 0;
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return Whether the vectorDistanceMetric field is set.
*/
@java.lang.Override public boolean hasVectorDistanceMetric() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return The enum numeric value on the wire for vectorDistanceMetric.
*/
@java.lang.Override public int getVectorDistanceMetricValue() {
return vectorDistanceMetric_;
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return The vectorDistanceMetric.
*/
@java.lang.Override public com.aerospike.vector.client.proto.VectorDistanceMetric getVectorDistanceMetric() {
com.aerospike.vector.client.proto.VectorDistanceMetric result = com.aerospike.vector.client.proto.VectorDistanceMetric.forNumber(vectorDistanceMetric_);
return result == null ? com.aerospike.vector.client.proto.VectorDistanceMetric.UNRECOGNIZED : result;
}
public static final int FIELD_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private volatile java.lang.Object field_ = "";
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @return The field.
*/
@java.lang.Override
public java.lang.String getField() {
java.lang.Object ref = field_;
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();
field_ = s;
return s;
}
}
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @return The bytes for field.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SETFILTER_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private volatile java.lang.Object setFilter_ = "";
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return Whether the setFilter field is set.
*/
@java.lang.Override
public boolean hasSetFilter() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return The setFilter.
*/
@java.lang.Override
public java.lang.String getSetFilter() {
java.lang.Object ref = setFilter_;
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();
setFilter_ = s;
return s;
}
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return The bytes for setFilter.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSetFilterBytes() {
java.lang.Object ref = setFilter_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
setFilter_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HNSWPARAMS_FIELD_NUMBER = 7;
/**
* .aerospike.vector.HnswParams hnswParams = 7;
* @return Whether the hnswParams field is set.
*/
@java.lang.Override
public boolean hasHnswParams() {
return paramsCase_ == 7;
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
* @return The hnswParams.
*/
@java.lang.Override
public com.aerospike.vector.client.proto.HnswParams getHnswParams() {
if (paramsCase_ == 7) {
return (com.aerospike.vector.client.proto.HnswParams) params_;
}
return com.aerospike.vector.client.proto.HnswParams.getDefaultInstance();
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
@java.lang.Override
public com.aerospike.vector.client.proto.HnswParamsOrBuilder getHnswParamsOrBuilder() {
if (paramsCase_ == 7) {
return (com.aerospike.vector.client.proto.HnswParams) params_;
}
return com.aerospike.vector.client.proto.HnswParams.getDefaultInstance();
}
public static final int LABELS_FIELD_NUMBER = 8;
private static final class LabelsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, java.lang.String> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
com.aerospike.vector.client.proto.Types.internal_static_aerospike_vector_IndexDefinition_LabelsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, java.lang.String> labels_;
private com.google.protobuf.MapField
internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(
LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public boolean containsLabels(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetLabels().getMap().containsKey(key);
}
/**
* Use {@link #getLabelsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public java.util.Map getLabelsMap() {
return internalGetLabels().getMap();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public /* nullable */
java.lang.String getLabelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetLabels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int STORAGE_FIELD_NUMBER = 9;
private com.aerospike.vector.client.proto.IndexStorage storage_;
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
* @return Whether the storage field is set.
*/
@java.lang.Override
public boolean hasStorage() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
* @return The storage.
*/
@java.lang.Override
public com.aerospike.vector.client.proto.IndexStorage getStorage() {
return storage_ == null ? com.aerospike.vector.client.proto.IndexStorage.getDefaultInstance() : storage_;
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
@java.lang.Override
public com.aerospike.vector.client.proto.IndexStorageOrBuilder getStorageOrBuilder() {
return storage_ == null ? com.aerospike.vector.client.proto.IndexStorage.getDefaultInstance() : storage_;
}
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 {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getId());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeEnum(2, type_);
}
if (dimensions_ != 0) {
output.writeUInt32(3, dimensions_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeEnum(4, vectorDistanceMetric_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, field_);
}
if (((bitField0_ & 0x00000008) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, setFilter_);
}
if (paramsCase_ == 7) {
output.writeMessage(7, (com.aerospike.vector.client.proto.HnswParams) params_);
}
com.google.protobuf.GeneratedMessageV3
.serializeStringMapTo(
output,
internalGetLabels(),
LabelsDefaultEntryHolder.defaultEntry,
8);
if (((bitField0_ & 0x00000010) != 0)) {
output.writeMessage(9, getStorage());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getId());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, type_);
}
if (dimensions_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, dimensions_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(4, vectorDistanceMetric_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, field_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, setFilter_);
}
if (paramsCase_ == 7) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(7, (com.aerospike.vector.client.proto.HnswParams) params_);
}
for (java.util.Map.Entry entry
: internalGetLabels().getMap().entrySet()) {
com.google.protobuf.MapEntry
labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(8, labels__);
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(9, getStorage());
}
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 com.aerospike.vector.client.proto.IndexDefinition)) {
return super.equals(obj);
}
com.aerospike.vector.client.proto.IndexDefinition other = (com.aerospike.vector.client.proto.IndexDefinition) obj;
if (hasId() != other.hasId()) return false;
if (hasId()) {
if (!getId()
.equals(other.getId())) return false;
}
if (hasType() != other.hasType()) return false;
if (hasType()) {
if (type_ != other.type_) return false;
}
if (getDimensions()
!= other.getDimensions()) return false;
if (hasVectorDistanceMetric() != other.hasVectorDistanceMetric()) return false;
if (hasVectorDistanceMetric()) {
if (vectorDistanceMetric_ != other.vectorDistanceMetric_) return false;
}
if (!getField()
.equals(other.getField())) return false;
if (hasSetFilter() != other.hasSetFilter()) return false;
if (hasSetFilter()) {
if (!getSetFilter()
.equals(other.getSetFilter())) return false;
}
if (!internalGetLabels().equals(
other.internalGetLabels())) return false;
if (hasStorage() != other.hasStorage()) return false;
if (hasStorage()) {
if (!getStorage()
.equals(other.getStorage())) return false;
}
if (!getParamsCase().equals(other.getParamsCase())) return false;
switch (paramsCase_) {
case 7:
if (!getHnswParams()
.equals(other.getHnswParams())) return false;
break;
case 0:
default:
}
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 (hasId()) {
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
}
if (hasType()) {
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
}
hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER;
hash = (53 * hash) + getDimensions();
if (hasVectorDistanceMetric()) {
hash = (37 * hash) + VECTORDISTANCEMETRIC_FIELD_NUMBER;
hash = (53 * hash) + vectorDistanceMetric_;
}
hash = (37 * hash) + FIELD_FIELD_NUMBER;
hash = (53 * hash) + getField().hashCode();
if (hasSetFilter()) {
hash = (37 * hash) + SETFILTER_FIELD_NUMBER;
hash = (53 * hash) + getSetFilter().hashCode();
}
if (!internalGetLabels().getMap().isEmpty()) {
hash = (37 * hash) + LABELS_FIELD_NUMBER;
hash = (53 * hash) + internalGetLabels().hashCode();
}
if (hasStorage()) {
hash = (37 * hash) + STORAGE_FIELD_NUMBER;
hash = (53 * hash) + getStorage().hashCode();
}
switch (paramsCase_) {
case 7:
hash = (37 * hash) + HNSWPARAMS_FIELD_NUMBER;
hash = (53 * hash) + getHnswParams().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.aerospike.vector.client.proto.IndexDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.aerospike.vector.client.proto.IndexDefinition 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 com.aerospike.vector.client.proto.IndexDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.aerospike.vector.client.proto.IndexDefinition 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 com.aerospike.vector.client.proto.IndexDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.aerospike.vector.client.proto.IndexDefinition 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(com.aerospike.vector.client.proto.IndexDefinition 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;
}
/**
*
* An index definition.
*
*
* Protobuf type {@code aerospike.vector.IndexDefinition}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:aerospike.vector.IndexDefinition)
com.aerospike.vector.client.proto.IndexDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.aerospike.vector.client.proto.Types.internal_static_aerospike_vector_IndexDefinition_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 8:
return internalGetLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 8:
return internalGetMutableLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.aerospike.vector.client.proto.Types.internal_static_aerospike_vector_IndexDefinition_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.aerospike.vector.client.proto.IndexDefinition.class, com.aerospike.vector.client.proto.IndexDefinition.Builder.class);
}
// Construct using com.aerospike.vector.client.proto.IndexDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getIdFieldBuilder();
getStorageFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
id_ = null;
if (idBuilder_ != null) {
idBuilder_.dispose();
idBuilder_ = null;
}
type_ = 0;
dimensions_ = 0;
vectorDistanceMetric_ = 0;
field_ = "";
setFilter_ = "";
if (hnswParamsBuilder_ != null) {
hnswParamsBuilder_.clear();
}
internalGetMutableLabels().clear();
storage_ = null;
if (storageBuilder_ != null) {
storageBuilder_.dispose();
storageBuilder_ = null;
}
paramsCase_ = 0;
params_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.aerospike.vector.client.proto.Types.internal_static_aerospike_vector_IndexDefinition_descriptor;
}
@java.lang.Override
public com.aerospike.vector.client.proto.IndexDefinition getDefaultInstanceForType() {
return com.aerospike.vector.client.proto.IndexDefinition.getDefaultInstance();
}
@java.lang.Override
public com.aerospike.vector.client.proto.IndexDefinition build() {
com.aerospike.vector.client.proto.IndexDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.aerospike.vector.client.proto.IndexDefinition buildPartial() {
com.aerospike.vector.client.proto.IndexDefinition result = new com.aerospike.vector.client.proto.IndexDefinition(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.aerospike.vector.client.proto.IndexDefinition result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.id_ = idBuilder_ == null
? id_
: idBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.type_ = type_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.dimensions_ = dimensions_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.vectorDistanceMetric_ = vectorDistanceMetric_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.field_ = field_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.setFilter_ = setFilter_;
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.labels_ = internalGetLabels();
result.labels_.makeImmutable();
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.storage_ = storageBuilder_ == null
? storage_
: storageBuilder_.build();
to_bitField0_ |= 0x00000010;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartialOneofs(com.aerospike.vector.client.proto.IndexDefinition result) {
result.paramsCase_ = paramsCase_;
result.params_ = this.params_;
if (paramsCase_ == 7 &&
hnswParamsBuilder_ != null) {
result.params_ = hnswParamsBuilder_.build();
}
}
@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 com.aerospike.vector.client.proto.IndexDefinition) {
return mergeFrom((com.aerospike.vector.client.proto.IndexDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.aerospike.vector.client.proto.IndexDefinition other) {
if (other == com.aerospike.vector.client.proto.IndexDefinition.getDefaultInstance()) return this;
if (other.hasId()) {
mergeId(other.getId());
}
if (other.hasType()) {
setType(other.getType());
}
if (other.getDimensions() != 0) {
setDimensions(other.getDimensions());
}
if (other.hasVectorDistanceMetric()) {
setVectorDistanceMetric(other.getVectorDistanceMetric());
}
if (!other.getField().isEmpty()) {
field_ = other.field_;
bitField0_ |= 0x00000010;
onChanged();
}
if (other.hasSetFilter()) {
setFilter_ = other.setFilter_;
bitField0_ |= 0x00000020;
onChanged();
}
internalGetMutableLabels().mergeFrom(
other.internalGetLabels());
bitField0_ |= 0x00000080;
if (other.hasStorage()) {
mergeStorage(other.getStorage());
}
switch (other.getParamsCase()) {
case HNSWPARAMS: {
mergeHnswParams(other.getHnswParams());
break;
}
case PARAMS_NOT_SET: {
break;
}
}
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: {
input.readMessage(
getIdFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
type_ = input.readEnum();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
dimensions_ = input.readUInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
vectorDistanceMetric_ = input.readEnum();
bitField0_ |= 0x00000008;
break;
} // case 32
case 42: {
field_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000010;
break;
} // case 42
case 50: {
setFilter_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000020;
break;
} // case 50
case 58: {
input.readMessage(
getHnswParamsFieldBuilder().getBuilder(),
extensionRegistry);
paramsCase_ = 7;
break;
} // case 58
case 66: {
com.google.protobuf.MapEntry
labels__ = input.readMessage(
LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
internalGetMutableLabels().getMutableMap().put(
labels__.getKey(), labels__.getValue());
bitField0_ |= 0x00000080;
break;
} // case 66
case 74: {
input.readMessage(
getStorageFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000100;
break;
} // case 74
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 paramsCase_ = 0;
private java.lang.Object params_;
public ParamsCase
getParamsCase() {
return ParamsCase.forNumber(
paramsCase_);
}
public Builder clearParams() {
paramsCase_ = 0;
params_ = null;
onChanged();
return this;
}
private int bitField0_;
private com.aerospike.vector.client.proto.IndexId id_;
private com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.IndexId, com.aerospike.vector.client.proto.IndexId.Builder, com.aerospike.vector.client.proto.IndexIdOrBuilder> idBuilder_;
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
* @return Whether the id field is set.
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
* @return The id.
*/
public com.aerospike.vector.client.proto.IndexId getId() {
if (idBuilder_ == null) {
return id_ == null ? com.aerospike.vector.client.proto.IndexId.getDefaultInstance() : id_;
} else {
return idBuilder_.getMessage();
}
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
public Builder setId(com.aerospike.vector.client.proto.IndexId value) {
if (idBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
} else {
idBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
public Builder setId(
com.aerospike.vector.client.proto.IndexId.Builder builderForValue) {
if (idBuilder_ == null) {
id_ = builderForValue.build();
} else {
idBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
public Builder mergeId(com.aerospike.vector.client.proto.IndexId value) {
if (idBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
id_ != null &&
id_ != com.aerospike.vector.client.proto.IndexId.getDefaultInstance()) {
getIdBuilder().mergeFrom(value);
} else {
id_ = value;
}
} else {
idBuilder_.mergeFrom(value);
}
if (id_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = null;
if (idBuilder_ != null) {
idBuilder_.dispose();
idBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
public com.aerospike.vector.client.proto.IndexId.Builder getIdBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getIdFieldBuilder().getBuilder();
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
public com.aerospike.vector.client.proto.IndexIdOrBuilder getIdOrBuilder() {
if (idBuilder_ != null) {
return idBuilder_.getMessageOrBuilder();
} else {
return id_ == null ?
com.aerospike.vector.client.proto.IndexId.getDefaultInstance() : id_;
}
}
/**
*
* The index identifier.
*
*
* .aerospike.vector.IndexId id = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.IndexId, com.aerospike.vector.client.proto.IndexId.Builder, com.aerospike.vector.client.proto.IndexIdOrBuilder>
getIdFieldBuilder() {
if (idBuilder_ == null) {
idBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.IndexId, com.aerospike.vector.client.proto.IndexId.Builder, com.aerospike.vector.client.proto.IndexIdOrBuilder>(
getId(),
getParentForChildren(),
isClean());
id_ = null;
}
return idBuilder_;
}
private int type_ = 0;
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return Whether the type field is set.
*/
@java.lang.Override public boolean hasType() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override public int getTypeValue() {
return type_;
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @param value The enum numeric value on the wire for type to set.
* @return This builder for chaining.
*/
public Builder setTypeValue(int value) {
type_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return The type.
*/
@java.lang.Override
public com.aerospike.vector.client.proto.IndexType getType() {
com.aerospike.vector.client.proto.IndexType result = com.aerospike.vector.client.proto.IndexType.forNumber(type_);
return result == null ? com.aerospike.vector.client.proto.IndexType.UNRECOGNIZED : result;
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(com.aerospike.vector.client.proto.IndexType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The type of index. Defaults to HNSW.
*
*
* optional .aerospike.vector.IndexType type = 2;
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000002);
type_ = 0;
onChanged();
return this;
}
private int dimensions_ ;
/**
*
* Number of dimensions in data.
* Vectors not matching the dimension count will not be indexed.
*
*
* uint32 dimensions = 3;
* @return The dimensions.
*/
@java.lang.Override
public int getDimensions() {
return dimensions_;
}
/**
*
* Number of dimensions in data.
* Vectors not matching the dimension count will not be indexed.
*
*
* uint32 dimensions = 3;
* @param value The dimensions to set.
* @return This builder for chaining.
*/
public Builder setDimensions(int value) {
dimensions_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* Number of dimensions in data.
* Vectors not matching the dimension count will not be indexed.
*
*
* uint32 dimensions = 3;
* @return This builder for chaining.
*/
public Builder clearDimensions() {
bitField0_ = (bitField0_ & ~0x00000004);
dimensions_ = 0;
onChanged();
return this;
}
private int vectorDistanceMetric_ = 0;
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return Whether the vectorDistanceMetric field is set.
*/
@java.lang.Override public boolean hasVectorDistanceMetric() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return The enum numeric value on the wire for vectorDistanceMetric.
*/
@java.lang.Override public int getVectorDistanceMetricValue() {
return vectorDistanceMetric_;
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @param value The enum numeric value on the wire for vectorDistanceMetric to set.
* @return This builder for chaining.
*/
public Builder setVectorDistanceMetricValue(int value) {
vectorDistanceMetric_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return The vectorDistanceMetric.
*/
@java.lang.Override
public com.aerospike.vector.client.proto.VectorDistanceMetric getVectorDistanceMetric() {
com.aerospike.vector.client.proto.VectorDistanceMetric result = com.aerospike.vector.client.proto.VectorDistanceMetric.forNumber(vectorDistanceMetric_);
return result == null ? com.aerospike.vector.client.proto.VectorDistanceMetric.UNRECOGNIZED : result;
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @param value The vectorDistanceMetric to set.
* @return This builder for chaining.
*/
public Builder setVectorDistanceMetric(com.aerospike.vector.client.proto.VectorDistanceMetric value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
vectorDistanceMetric_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
*
*
* optional .aerospike.vector.VectorDistanceMetric vectorDistanceMetric = 4;
* @return This builder for chaining.
*/
public Builder clearVectorDistanceMetric() {
bitField0_ = (bitField0_ & ~0x00000008);
vectorDistanceMetric_ = 0;
onChanged();
return this;
}
private java.lang.Object field_ = "";
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @return The field.
*/
public java.lang.String getField() {
java.lang.Object ref = field_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
field_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @return The bytes for field.
*/
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @param value The field to set.
* @return This builder for chaining.
*/
public Builder setField(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
field_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @return This builder for chaining.
*/
public Builder clearField() {
field_ = getDefaultInstance().getField();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
*
* Name of the record vector field to index.
*
*
* string field = 5;
* @param value The bytes for field to set.
* @return This builder for chaining.
*/
public Builder setFieldBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
field_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
private java.lang.Object setFilter_ = "";
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return Whether the setFilter field is set.
*/
public boolean hasSetFilter() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return The setFilter.
*/
public java.lang.String getSetFilter() {
java.lang.Object ref = setFilter_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
setFilter_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return The bytes for setFilter.
*/
public com.google.protobuf.ByteString
getSetFilterBytes() {
java.lang.Object ref = setFilter_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
setFilter_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @param value The setFilter to set.
* @return This builder for chaining.
*/
public Builder setSetFilter(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
setFilter_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @return This builder for chaining.
*/
public Builder clearSetFilter() {
setFilter_ = getDefaultInstance().getSetFilter();
bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
return this;
}
/**
*
* Optional filter on Aerospike set name from which records will be indexed.
* If not specified all sets in the index namespace will be indexed.
*
*
* optional string setFilter = 6;
* @param value The bytes for setFilter to set.
* @return This builder for chaining.
*/
public Builder setSetFilterBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
setFilter_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.HnswParams, com.aerospike.vector.client.proto.HnswParams.Builder, com.aerospike.vector.client.proto.HnswParamsOrBuilder> hnswParamsBuilder_;
/**
* .aerospike.vector.HnswParams hnswParams = 7;
* @return Whether the hnswParams field is set.
*/
@java.lang.Override
public boolean hasHnswParams() {
return paramsCase_ == 7;
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
* @return The hnswParams.
*/
@java.lang.Override
public com.aerospike.vector.client.proto.HnswParams getHnswParams() {
if (hnswParamsBuilder_ == null) {
if (paramsCase_ == 7) {
return (com.aerospike.vector.client.proto.HnswParams) params_;
}
return com.aerospike.vector.client.proto.HnswParams.getDefaultInstance();
} else {
if (paramsCase_ == 7) {
return hnswParamsBuilder_.getMessage();
}
return com.aerospike.vector.client.proto.HnswParams.getDefaultInstance();
}
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
public Builder setHnswParams(com.aerospike.vector.client.proto.HnswParams value) {
if (hnswParamsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
params_ = value;
onChanged();
} else {
hnswParamsBuilder_.setMessage(value);
}
paramsCase_ = 7;
return this;
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
public Builder setHnswParams(
com.aerospike.vector.client.proto.HnswParams.Builder builderForValue) {
if (hnswParamsBuilder_ == null) {
params_ = builderForValue.build();
onChanged();
} else {
hnswParamsBuilder_.setMessage(builderForValue.build());
}
paramsCase_ = 7;
return this;
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
public Builder mergeHnswParams(com.aerospike.vector.client.proto.HnswParams value) {
if (hnswParamsBuilder_ == null) {
if (paramsCase_ == 7 &&
params_ != com.aerospike.vector.client.proto.HnswParams.getDefaultInstance()) {
params_ = com.aerospike.vector.client.proto.HnswParams.newBuilder((com.aerospike.vector.client.proto.HnswParams) params_)
.mergeFrom(value).buildPartial();
} else {
params_ = value;
}
onChanged();
} else {
if (paramsCase_ == 7) {
hnswParamsBuilder_.mergeFrom(value);
} else {
hnswParamsBuilder_.setMessage(value);
}
}
paramsCase_ = 7;
return this;
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
public Builder clearHnswParams() {
if (hnswParamsBuilder_ == null) {
if (paramsCase_ == 7) {
paramsCase_ = 0;
params_ = null;
onChanged();
}
} else {
if (paramsCase_ == 7) {
paramsCase_ = 0;
params_ = null;
}
hnswParamsBuilder_.clear();
}
return this;
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
public com.aerospike.vector.client.proto.HnswParams.Builder getHnswParamsBuilder() {
return getHnswParamsFieldBuilder().getBuilder();
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
@java.lang.Override
public com.aerospike.vector.client.proto.HnswParamsOrBuilder getHnswParamsOrBuilder() {
if ((paramsCase_ == 7) && (hnswParamsBuilder_ != null)) {
return hnswParamsBuilder_.getMessageOrBuilder();
} else {
if (paramsCase_ == 7) {
return (com.aerospike.vector.client.proto.HnswParams) params_;
}
return com.aerospike.vector.client.proto.HnswParams.getDefaultInstance();
}
}
/**
* .aerospike.vector.HnswParams hnswParams = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.HnswParams, com.aerospike.vector.client.proto.HnswParams.Builder, com.aerospike.vector.client.proto.HnswParamsOrBuilder>
getHnswParamsFieldBuilder() {
if (hnswParamsBuilder_ == null) {
if (!(paramsCase_ == 7)) {
params_ = com.aerospike.vector.client.proto.HnswParams.getDefaultInstance();
}
hnswParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.HnswParams, com.aerospike.vector.client.proto.HnswParams.Builder, com.aerospike.vector.client.proto.HnswParamsOrBuilder>(
(com.aerospike.vector.client.proto.HnswParams) params_,
getParentForChildren(),
isClean());
params_ = null;
}
paramsCase_ = 7;
onChanged();
return hnswParamsBuilder_;
}
private com.google.protobuf.MapField<
java.lang.String, java.lang.String> labels_;
private com.google.protobuf.MapField
internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(
LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
private com.google.protobuf.MapField
internalGetMutableLabels() {
if (labels_ == null) {
labels_ = com.google.protobuf.MapField.newMapField(
LabelsDefaultEntryHolder.defaultEntry);
}
if (!labels_.isMutable()) {
labels_ = labels_.copy();
}
bitField0_ |= 0x00000080;
onChanged();
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public boolean containsLabels(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetLabels().getMap().containsKey(key);
}
/**
* Use {@link #getLabelsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public java.util.Map getLabelsMap() {
return internalGetLabels().getMap();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public /* nullable */
java.lang.String getLabelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetLabels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearLabels() {
bitField0_ = (bitField0_ & ~0x00000080);
internalGetMutableLabels().getMutableMap()
.clear();
return this;
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
public Builder removeLabels(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
internalGetMutableLabels().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutableLabels() {
bitField0_ |= 0x00000080;
return internalGetMutableLabels().getMutableMap();
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
public Builder putLabels(
java.lang.String key,
java.lang.String value) {
if (key == null) { throw new NullPointerException("map key"); }
if (value == null) { throw new NullPointerException("map value"); }
internalGetMutableLabels().getMutableMap()
.put(key, value);
bitField0_ |= 0x00000080;
return this;
}
/**
*
* Optional labels associated with the index.
*
*
* map<string, string> labels = 8;
*/
public Builder putAllLabels(
java.util.Map values) {
internalGetMutableLabels().getMutableMap()
.putAll(values);
bitField0_ |= 0x00000080;
return this;
}
private com.aerospike.vector.client.proto.IndexStorage storage_;
private com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.IndexStorage, com.aerospike.vector.client.proto.IndexStorage.Builder, com.aerospike.vector.client.proto.IndexStorageOrBuilder> storageBuilder_;
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
* @return Whether the storage field is set.
*/
public boolean hasStorage() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
* @return The storage.
*/
public com.aerospike.vector.client.proto.IndexStorage getStorage() {
if (storageBuilder_ == null) {
return storage_ == null ? com.aerospike.vector.client.proto.IndexStorage.getDefaultInstance() : storage_;
} else {
return storageBuilder_.getMessage();
}
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
public Builder setStorage(com.aerospike.vector.client.proto.IndexStorage value) {
if (storageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
storage_ = value;
} else {
storageBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
public Builder setStorage(
com.aerospike.vector.client.proto.IndexStorage.Builder builderForValue) {
if (storageBuilder_ == null) {
storage_ = builderForValue.build();
} else {
storageBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
public Builder mergeStorage(com.aerospike.vector.client.proto.IndexStorage value) {
if (storageBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0) &&
storage_ != null &&
storage_ != com.aerospike.vector.client.proto.IndexStorage.getDefaultInstance()) {
getStorageBuilder().mergeFrom(value);
} else {
storage_ = value;
}
} else {
storageBuilder_.mergeFrom(value);
}
if (storage_ != null) {
bitField0_ |= 0x00000100;
onChanged();
}
return this;
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
public Builder clearStorage() {
bitField0_ = (bitField0_ & ~0x00000100);
storage_ = null;
if (storageBuilder_ != null) {
storageBuilder_.dispose();
storageBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
public com.aerospike.vector.client.proto.IndexStorage.Builder getStorageBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getStorageFieldBuilder().getBuilder();
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
public com.aerospike.vector.client.proto.IndexStorageOrBuilder getStorageOrBuilder() {
if (storageBuilder_ != null) {
return storageBuilder_.getMessageOrBuilder();
} else {
return storage_ == null ?
com.aerospike.vector.client.proto.IndexStorage.getDefaultInstance() : storage_;
}
}
/**
*
* Index storage.
*
*
* optional .aerospike.vector.IndexStorage storage = 9;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.IndexStorage, com.aerospike.vector.client.proto.IndexStorage.Builder, com.aerospike.vector.client.proto.IndexStorageOrBuilder>
getStorageFieldBuilder() {
if (storageBuilder_ == null) {
storageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.aerospike.vector.client.proto.IndexStorage, com.aerospike.vector.client.proto.IndexStorage.Builder, com.aerospike.vector.client.proto.IndexStorageOrBuilder>(
getStorage(),
getParentForChildren(),
isClean());
storage_ = null;
}
return storageBuilder_;
}
@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:aerospike.vector.IndexDefinition)
}
// @@protoc_insertion_point(class_scope:aerospike.vector.IndexDefinition)
private static final com.aerospike.vector.client.proto.IndexDefinition DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.aerospike.vector.client.proto.IndexDefinition();
}
public static com.aerospike.vector.client.proto.IndexDefinition getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public IndexDefinition 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 com.aerospike.vector.client.proto.IndexDefinition getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy