Class Key.PathElement (2.23.0)

publicstaticfinalclass Key.PathElementextendsGeneratedMessageV3implementsKey.PathElementOrBuilder

A (kind, ID/name) pair used to construct a key path.

If either name or ID is set, the element is complete. If neither is set, the element is incomplete.

Protobuf type google.datastore.v1.Key.PathElement

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

ID_FIELD_NUMBER

publicstaticfinalintID_FIELD_NUMBER
Field Value
Type Description
int

KIND_FIELD_NUMBER

publicstaticfinalintKIND_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

publicstaticfinalintNAME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticKey.PathElementgetDefaultInstance()
Returns
Type Description
Key.PathElement

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticKey.PathElement.BuildernewBuilder()
Returns
Type Description
Key.PathElement.Builder

newBuilder(Key.PathElement prototype)

publicstaticKey.PathElement.BuildernewBuilder(Key.PathElementprototype)
Parameter
Name Description
prototype Key.PathElement
Returns
Type Description
Key.PathElement.Builder

parseDelimitedFrom(InputStream input)

publicstaticKey.PathElementparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Key.PathElement
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticKey.PathElementparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Key.PathElement
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticKey.PathElementparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Key.PathElement
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticKey.PathElementparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Key.PathElement
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticKey.PathElementparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Key.PathElement
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticKey.PathElementparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Key.PathElement
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticKey.PathElementparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Key.PathElement
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticKey.PathElementparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Key.PathElement
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticKey.PathElementparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Key.PathElement
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticKey.PathElementparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Key.PathElement
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticKey.PathElementparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Key.PathElement
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticKey.PathElementparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Key.PathElement
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Key.PathElement>parser()
Returns
Type Description
Parser<PathElement>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

publicKey.PathElementgetDefaultInstanceForType()
Returns
Type Description
Key.PathElement

getId()

publiclonggetId()

The auto-allocated ID of the entity.

Never equal to zero. Values less than zero are discouraged and may not be supported in the future.

int64 id = 2;

Returns
Type Description
long

The id.

getIdTypeCase()

publicKey.PathElement.IdTypeCasegetIdTypeCase()
Returns
Type Description
Key.PathElement.IdTypeCase

getKind()

publicStringgetKind()

The kind of the entity.

A kind matching regex .* is reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 encoded. Cannot be "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as bytes<X> where <X> is the base-64 encoding of the bytes.

string kind = 1;

Returns
Type Description
String

The kind.

getKindBytes()

publicByteStringgetKindBytes()

The kind of the entity.

A kind matching regex .* is reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 encoded. Cannot be "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as bytes<X> where <X> is the base-64 encoding of the bytes.

string kind = 1;

Returns
Type Description
ByteString

The bytes for kind.

getName()

publicStringgetName()

The name of the entity.

A name matching regex .* is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as bytes<X> where <X> is the base-64 encoding of the bytes.

string name = 3;

Returns
Type Description
String

The name.

getNameBytes()

publicByteStringgetNameBytes()

The name of the entity.

A name matching regex .* is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as bytes<X> where <X> is the base-64 encoding of the bytes.

string name = 3;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

publicParser<Key.PathElement>getParserForType()
Returns
Type Description
Parser<PathElement>
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

hasId()

publicbooleanhasId()

The auto-allocated ID of the entity.

Never equal to zero. Values less than zero are discouraged and may not be supported in the future.

int64 id = 2;

Returns
Type Description
boolean

Whether the id field is set.

hasName()

publicbooleanhasName()

The name of the entity.

A name matching regex .* is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as bytes<X> where <X> is the base-64 encoding of the bytes.

string name = 3;

Returns
Type Description
boolean

Whether the name field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicKey.PathElement.BuildernewBuilderForType()
Returns
Type Description
Key.PathElement.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedKey.PathElement.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Key.PathElement.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

publicKey.PathElement.BuildertoBuilder()
Returns
Type Description
Key.PathElement.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.