Class SparseVector.Builder (0.1.0)

public static final class SparseVector.Builder extends GeneratedMessageV3.Builder<SparseVector.Builder> implements SparseVectorOrBuilder

A sparse vector.

Protobuf type google.cloud.vectorsearch.v1beta.SparseVector

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllIndices(Iterable<? extends Integer> values)

public SparseVector.Builder addAllIndices(Iterable<? extends Integer> values)

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<? extends java.lang.Integer>

The indices to add.

Returns
Type Description
SparseVector.Builder

This builder for chaining.

addAllValues(Iterable<? extends Float> values)

public SparseVector.Builder addAllValues(Iterable<? extends Float> values)

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<? extends java.lang.Float>

The values to add.

Returns
Type Description
SparseVector.Builder

This builder for chaining.

addIndices(int value)

public SparseVector.Builder addIndices(int value)

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

The indices to add.

Returns
Type Description
SparseVector.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SparseVector.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SparseVector.Builder
Overrides

addValues(float value)

public SparseVector.Builder addValues(float value)

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value float

The values to add.

Returns
Type Description
SparseVector.Builder

This builder for chaining.

build()

public SparseVector build()
Returns
Type Description
SparseVector

buildPartial()

public SparseVector buildPartial()
Returns
Type Description
SparseVector

clear()

public SparseVector.Builder clear()
Returns
Type Description
SparseVector.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public SparseVector.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SparseVector.Builder
Overrides

clearIndices()

public SparseVector.Builder clearIndices()

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SparseVector.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SparseVector.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SparseVector.Builder
Overrides

clearValues()

public SparseVector.Builder clearValues()

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SparseVector.Builder

This builder for chaining.

clone()

public SparseVector.Builder clone()
Returns
Type Description
SparseVector.Builder
Overrides

getDefaultInstanceForType()

public SparseVector getDefaultInstanceForType()
Returns
Type Description
SparseVector

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getIndices(int index)

public int getIndices(int index)

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
int

The indices at the given index.

getIndicesCount()

public int getIndicesCount()

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of indices.

getIndicesList()

public List<Integer> getIndicesList()

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Integer>

A list containing the indices.

getValues(int index)

public float getValues(int index)

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
float

The values at the given index.

getValuesCount()

public int getValuesCount()

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of values.

getValuesList()

public List<Float> getValuesList()

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Float>

A list containing the values.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SparseVector other)

public SparseVector.Builder mergeFrom(SparseVector other)
Parameter
Name Description
other SparseVector
Returns
Type Description
SparseVector.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SparseVector.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SparseVector.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SparseVector.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SparseVector.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SparseVector.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SparseVector.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public SparseVector.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SparseVector.Builder
Overrides

setIndices(int index, int value)

public SparseVector.Builder setIndices(int index, int value)

Required. The corresponding indices for the values.

repeated int32 indices = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int

The index to set the value at.

value int

The indices to set.

Returns
Type Description
SparseVector.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public SparseVector.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SparseVector.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final SparseVector.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SparseVector.Builder
Overrides

setValues(int index, float value)

public SparseVector.Builder setValues(int index, float value)

Required. The values of the vector.

repeated float values = 1 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int

The index to set the value at.

value float

The values to set.

Returns
Type Description
SparseVector.Builder

This builder for chaining.