Class PartitionId.Builder (2.32.3)

publicstaticfinalclass PartitionId.BuilderextendsGeneratedMessageV3.Builder<PartitionId.Builder>implementsPartitionIdOrBuilder

A partition ID identifies a grouping of entities. The grouping is always by project and namespace, however the namespace ID may be empty.

A partition ID contains several dimensions: project ID and namespace ID.

Partition dimensions:

  • May be "".
  • Must be valid UTF-8 bytes.
  • Must have values that match regex [A-Za-z\d\.\-]{1,100} If the value of any dimension matches regex _.*__, the partition is reserved/read-only. A reserved/read-only partition ID is forbidden in certain documented contexts.

    Foreign partition IDs (in which the project ID does not match the context project ID ) are discouraged. Reads and writes of foreign partition IDs may fail if the project is not in an active state.

Protobuf type google.datastore.v1.PartitionId

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicPartitionId.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
PartitionId.Builder
Overrides

build()

publicPartitionIdbuild()
Returns
Type Description
PartitionId

buildPartial()

publicPartitionIdbuildPartial()
Returns
Type Description
PartitionId

clear()

publicPartitionId.Builderclear()
Returns
Type Description
PartitionId.Builder
Overrides

clearDatabaseId()

publicPartitionId.BuilderclearDatabaseId()

If not empty, the ID of the database to which the entities belong.

string database_id = 3;

Returns
Type Description
PartitionId.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicPartitionId.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
PartitionId.Builder
Overrides

clearNamespaceId()

publicPartitionId.BuilderclearNamespaceId()

If not empty, the ID of the namespace to which the entities belong.

string namespace_id = 4;

Returns
Type Description
PartitionId.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicPartitionId.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
PartitionId.Builder
Overrides

clearProjectId()

publicPartitionId.BuilderclearProjectId()

The ID of the project to which the entities belong.

string project_id = 2;

Returns
Type Description
PartitionId.Builder

This builder for chaining.

clone()

publicPartitionId.Builderclone()
Returns
Type Description
PartitionId.Builder
Overrides

getDatabaseId()

publicStringgetDatabaseId()

If not empty, the ID of the database to which the entities belong.

string database_id = 3;

Returns
Type Description
String

The databaseId.

getDatabaseIdBytes()

publicByteStringgetDatabaseIdBytes()

If not empty, the ID of the database to which the entities belong.

string database_id = 3;

Returns
Type Description
ByteString

The bytes for databaseId.

getDefaultInstanceForType()

publicPartitionIdgetDefaultInstanceForType()
Returns
Type Description
PartitionId

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getNamespaceId()

publicStringgetNamespaceId()

If not empty, the ID of the namespace to which the entities belong.

string namespace_id = 4;

Returns
Type Description
String

The namespaceId.

getNamespaceIdBytes()

publicByteStringgetNamespaceIdBytes()

If not empty, the ID of the namespace to which the entities belong.

string namespace_id = 4;

Returns
Type Description
ByteString

The bytes for namespaceId.

getProjectId()

publicStringgetProjectId()

The ID of the project to which the entities belong.

string project_id = 2;

Returns
Type Description
String

The projectId.

getProjectIdBytes()

publicByteStringgetProjectIdBytes()

The ID of the project to which the entities belong.

string project_id = 2;

Returns
Type Description
ByteString

The bytes for projectId.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(PartitionId other)

publicPartitionId.BuildermergeFrom(PartitionIdother)
Parameter
Name Description
other PartitionId
Returns
Type Description
PartitionId.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicPartitionId.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicPartitionId.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
PartitionId.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalPartitionId.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PartitionId.Builder
Overrides

setDatabaseId(String value)

publicPartitionId.BuildersetDatabaseId(Stringvalue)

If not empty, the ID of the database to which the entities belong.

string database_id = 3;

Parameter
Name Description
value String

The databaseId to set.

Returns
Type Description
PartitionId.Builder

This builder for chaining.

setDatabaseIdBytes(ByteString value)

publicPartitionId.BuildersetDatabaseIdBytes(ByteStringvalue)

If not empty, the ID of the database to which the entities belong.

string database_id = 3;

Parameter
Name Description
value ByteString

The bytes for databaseId to set.

Returns
Type Description
PartitionId.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicPartitionId.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
PartitionId.Builder
Overrides

setNamespaceId(String value)

publicPartitionId.BuildersetNamespaceId(Stringvalue)

If not empty, the ID of the namespace to which the entities belong.

string namespace_id = 4;

Parameter
Name Description
value String

The namespaceId to set.

Returns
Type Description
PartitionId.Builder

This builder for chaining.

setNamespaceIdBytes(ByteString value)

publicPartitionId.BuildersetNamespaceIdBytes(ByteStringvalue)

If not empty, the ID of the namespace to which the entities belong.

string namespace_id = 4;

Parameter
Name Description
value ByteString

The bytes for namespaceId to set.

Returns
Type Description
PartitionId.Builder

This builder for chaining.

setProjectId(String value)

publicPartitionId.BuildersetProjectId(Stringvalue)

The ID of the project to which the entities belong.

string project_id = 2;

Parameter
Name Description
value String

The projectId to set.

Returns
Type Description
PartitionId.Builder

This builder for chaining.

setProjectIdBytes(ByteString value)

publicPartitionId.BuildersetProjectIdBytes(ByteStringvalue)

The ID of the project to which the entities belong.

string project_id = 2;

Parameter
Name Description
value ByteString

The bytes for projectId to set.

Returns
Type Description
PartitionId.Builder

This builder for chaining.

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

publicPartitionId.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
PartitionId.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalPartitionId.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PartitionId.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.