Class KeyRecipe.Builder (6.107.0)

public static final class KeyRecipe.Builder extends GeneratedMessageV3.Builder<KeyRecipe.Builder> implements KeyRecipeOrBuilder

A KeyRecipe provides the metadata required to translate reads, mutations, and queries into a byte array in "sortable string format" (ssformat)that can be used with Ranges to route requests. Note that the client must tolerate KeyRecipes that appear to be invalid, since the KeyRecipe format may change over time. Requests with invalid KeyRecipes should be routed to a default server.

Protobuf type google.spanner.v1.KeyRecipe

Implements

KeyRecipeOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllPart(Iterable<? extends KeyRecipe.Part> values)

public KeyRecipe.Builder addAllPart(Iterable<? extends KeyRecipe.Part> values)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
values Iterable<? extends com.google.spanner.v1.KeyRecipe.Part>
Returns
Type Description
KeyRecipe.Builder

addPart(KeyRecipe.Part value)

public KeyRecipe.Builder addPart(KeyRecipe.Part value)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
value KeyRecipe.Part
Returns
Type Description
KeyRecipe.Builder

addPart(KeyRecipe.Part.Builder builderForValue)

public KeyRecipe.Builder addPart(KeyRecipe.Part.Builder builderForValue)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
builderForValue KeyRecipe.Part.Builder
Returns
Type Description
KeyRecipe.Builder

addPart(int index, KeyRecipe.Part value)

public KeyRecipe.Builder addPart(int index, KeyRecipe.Part value)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameters
Name Description
index int
value KeyRecipe.Part
Returns
Type Description
KeyRecipe.Builder

addPart(int index, KeyRecipe.Part.Builder builderForValue)

public KeyRecipe.Builder addPart(int index, KeyRecipe.Part.Builder builderForValue)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameters
Name Description
index int
builderForValue KeyRecipe.Part.Builder
Returns
Type Description
KeyRecipe.Builder

addPartBuilder()

public KeyRecipe.Part.Builder addPartBuilder()

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Returns
Type Description
KeyRecipe.Part.Builder

addPartBuilder(int index)

public KeyRecipe.Part.Builder addPartBuilder(int index)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
index int
Returns
Type Description
KeyRecipe.Part.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public KeyRecipe build()
Returns
Type Description
KeyRecipe

buildPartial()

public KeyRecipe buildPartial()
Returns
Type Description
KeyRecipe

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearIndexName()

public KeyRecipe.Builder clearIndexName()

An index name, matching the name from the database schema.

string index_name = 2;

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearOperationUid()

public KeyRecipe.Builder clearOperationUid()

The UID of a query, matching the UID from RoutingHint.

uint64 operation_uid = 3;

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

clearPart()

public KeyRecipe.Builder clearPart()

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Returns
Type Description
KeyRecipe.Builder

clearTableName()

public KeyRecipe.Builder clearTableName()

A table name, matching the name from the database schema.

string table_name = 1;

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

clearTarget()

public KeyRecipe.Builder clearTarget()
Returns
Type Description
KeyRecipe.Builder

clone()

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

getDefaultInstanceForType()

public KeyRecipe getDefaultInstanceForType()
Returns
Type Description
KeyRecipe

getDescriptorForType()

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

getIndexName()

public String getIndexName()

An index name, matching the name from the database schema.

string index_name = 2;

Returns
Type Description
String

The indexName.

getIndexNameBytes()

public ByteString getIndexNameBytes()

An index name, matching the name from the database schema.

string index_name = 2;

Returns
Type Description
ByteString

The bytes for indexName.

getOperationUid()

public long getOperationUid()

The UID of a query, matching the UID from RoutingHint.

uint64 operation_uid = 3;

Returns
Type Description
long

The operationUid.

getPart(int index)

public KeyRecipe.Part getPart(int index)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
index int
Returns
Type Description
KeyRecipe.Part

getPartBuilder(int index)

public KeyRecipe.Part.Builder getPartBuilder(int index)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
index int
Returns
Type Description
KeyRecipe.Part.Builder

getPartBuilderList()

public List<KeyRecipe.Part.Builder> getPartBuilderList()

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Returns
Type Description
List<Builder>

getPartCount()

public int getPartCount()

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Returns
Type Description
int

getPartList()

public List<KeyRecipe.Part> getPartList()

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Returns
Type Description
List<Part>

getPartOrBuilder(int index)

public KeyRecipe.PartOrBuilder getPartOrBuilder(int index)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
index int
Returns
Type Description
KeyRecipe.PartOrBuilder

getPartOrBuilderList()

public List<? extends KeyRecipe.PartOrBuilder> getPartOrBuilderList()

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Returns
Type Description
List<? extends com.google.spanner.v1.KeyRecipe.PartOrBuilder>

getTableName()

public String getTableName()

A table name, matching the name from the database schema.

string table_name = 1;

Returns
Type Description
String

The tableName.

getTableNameBytes()

public ByteString getTableNameBytes()

A table name, matching the name from the database schema.

string table_name = 1;

Returns
Type Description
ByteString

The bytes for tableName.

getTargetCase()

public KeyRecipe.TargetCase getTargetCase()
Returns
Type Description
KeyRecipe.TargetCase

hasIndexName()

public boolean hasIndexName()

An index name, matching the name from the database schema.

string index_name = 2;

Returns
Type Description
boolean

Whether the indexName field is set.

hasOperationUid()

public boolean hasOperationUid()

The UID of a query, matching the UID from RoutingHint.

uint64 operation_uid = 3;

Returns
Type Description
boolean

Whether the operationUid field is set.

hasTableName()

public boolean hasTableName()

A table name, matching the name from the database schema.

string table_name = 1;

Returns
Type Description
boolean

Whether the tableName field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(KeyRecipe other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removePart(int index)

public KeyRecipe.Builder removePart(int index)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameter
Name Description
index int
Returns
Type Description
KeyRecipe.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setIndexName(String value)

public KeyRecipe.Builder setIndexName(String value)

An index name, matching the name from the database schema.

string index_name = 2;

Parameter
Name Description
value String

The indexName to set.

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

setIndexNameBytes(ByteString value)

public KeyRecipe.Builder setIndexNameBytes(ByteString value)

An index name, matching the name from the database schema.

string index_name = 2;

Parameter
Name Description
value ByteString

The bytes for indexName to set.

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

setOperationUid(long value)

public KeyRecipe.Builder setOperationUid(long value)

The UID of a query, matching the UID from RoutingHint.

uint64 operation_uid = 3;

Parameter
Name Description
value long

The operationUid to set.

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

setPart(int index, KeyRecipe.Part value)

public KeyRecipe.Builder setPart(int index, KeyRecipe.Part value)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameters
Name Description
index int
value KeyRecipe.Part
Returns
Type Description
KeyRecipe.Builder

setPart(int index, KeyRecipe.Part.Builder builderForValue)

public KeyRecipe.Builder setPart(int index, KeyRecipe.Part.Builder builderForValue)

Parts are in the order they should appear in the encoded key.

repeated .google.spanner.v1.KeyRecipe.Part part = 4;

Parameters
Name Description
index int
builderForValue KeyRecipe.Part.Builder
Returns
Type Description
KeyRecipe.Builder

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

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

setTableName(String value)

public KeyRecipe.Builder setTableName(String value)

A table name, matching the name from the database schema.

string table_name = 1;

Parameter
Name Description
value String

The tableName to set.

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

setTableNameBytes(ByteString value)

public KeyRecipe.Builder setTableNameBytes(ByteString value)

A table name, matching the name from the database schema.

string table_name = 1;

Parameter
Name Description
value ByteString

The bytes for tableName to set.

Returns
Type Description
KeyRecipe.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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