Class PartitionId (2.24.3)

publicfinalclass PartitionIdextendsGeneratedMessageV3implementsPartitionIdOrBuilder

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.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

DATABASE_ID_FIELD_NUMBER

publicstaticfinalintDATABASE_ID_FIELD_NUMBER
Field Value
Type Description
int

NAMESPACE_ID_FIELD_NUMBER

publicstaticfinalintNAMESPACE_ID_FIELD_NUMBER
Field Value
Type Description
int

PROJECT_ID_FIELD_NUMBER

publicstaticfinalintPROJECT_ID_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticPartitionIdgetDefaultInstance()
Returns
Type Description
PartitionId

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticPartitionId.BuildernewBuilder()
Returns
Type Description
PartitionId.Builder

newBuilder(PartitionId prototype)

publicstaticPartitionId.BuildernewBuilder(PartitionIdprototype)
Parameter
Name Description
prototype PartitionId
Returns
Type Description
PartitionId.Builder

parseDelimitedFrom(InputStream input)

publicstaticPartitionIdparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
PartitionId
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticPartitionIdparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticPartitionIdparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
PartitionId
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticPartitionIdparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticPartitionIdparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
PartitionId
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticPartitionIdparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticPartitionIdparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
PartitionId
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticPartitionIdparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticPartitionIdparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
PartitionId
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticPartitionIdparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticPartitionIdparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
PartitionId
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticPartitionIdparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PartitionId
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<PartitionId>parser()
Returns
Type Description
Parser<PartitionId>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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

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.

getParserForType()

publicParser<PartitionId>getParserForType()
Returns
Type Description
Parser<PartitionId>
Overrides

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.

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicPartitionId.BuildernewBuilderForType()
Returns
Type Description
PartitionId.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedPartitionId.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
PartitionId.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicPartitionId.BuildertoBuilder()
Returns
Type Description
PartitionId.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

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.