Class Key.Builder (0.14.1)

public static final class Key.Builder extends GeneratedMessageV3.Builder<Key.Builder> implements KeyOrBuilder

A unique identifier for an entity. If a key's partition ID or any of its path kinds or names are reserved/read-only, the key is reserved/read-only. A reserved/read-only key is forbidden in certain documented contexts.

Protobuf type google.events.cloud.datastore.v1.Key

Implements

KeyOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllPath(Iterable<? extends Key.PathElement> values)

public Key.Builder addAllPath(Iterable<? extends Key.PathElement> values)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.events.cloud.datastore.v1.Key.PathElement>
Returns
TypeDescription
Key.Builder

addPath(Key.PathElement value)

public Key.Builder addPath(Key.PathElement value)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
valueKey.PathElement
Returns
TypeDescription
Key.Builder

addPath(Key.PathElement.Builder builderForValue)

public Key.Builder addPath(Key.PathElement.Builder builderForValue)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
builderForValueKey.PathElement.Builder
Returns
TypeDescription
Key.Builder

addPath(int index, Key.PathElement value)

public Key.Builder addPath(int index, Key.PathElement value)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameters
NameDescription
indexint
valueKey.PathElement
Returns
TypeDescription
Key.Builder

addPath(int index, Key.PathElement.Builder builderForValue)

public Key.Builder addPath(int index, Key.PathElement.Builder builderForValue)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameters
NameDescription
indexint
builderForValueKey.PathElement.Builder
Returns
TypeDescription
Key.Builder

addPathBuilder()

public Key.PathElement.Builder addPathBuilder()

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Returns
TypeDescription
Key.PathElement.Builder

addPathBuilder(int index)

public Key.PathElement.Builder addPathBuilder(int index)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Key.PathElement.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Key.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Key.Builder
Overrides

build()

public Key build()
Returns
TypeDescription
Key

buildPartial()

public Key buildPartial()
Returns
TypeDescription
Key

clear()

public Key.Builder clear()
Returns
TypeDescription
Key.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Key.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Key.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Key.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Key.Builder
Overrides

clearPartitionId()

public Key.Builder clearPartitionId()

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Returns
TypeDescription
Key.Builder

clearPath()

public Key.Builder clearPath()

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Returns
TypeDescription
Key.Builder

clone()

public Key.Builder clone()
Returns
TypeDescription
Key.Builder
Overrides

getDefaultInstanceForType()

public Key getDefaultInstanceForType()
Returns
TypeDescription
Key

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getPartitionId()

public PartitionId getPartitionId()

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Returns
TypeDescription
PartitionId

The partitionId.

getPartitionIdBuilder()

public PartitionId.Builder getPartitionIdBuilder()

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Returns
TypeDescription
PartitionId.Builder

getPartitionIdOrBuilder()

public PartitionIdOrBuilder getPartitionIdOrBuilder()

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Returns
TypeDescription
PartitionIdOrBuilder

getPath(int index)

public Key.PathElement getPath(int index)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Key.PathElement

getPathBuilder(int index)

public Key.PathElement.Builder getPathBuilder(int index)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Key.PathElement.Builder

getPathBuilderList()

public List<Key.PathElement.Builder> getPathBuilderList()

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Returns
TypeDescription
List<Builder>

getPathCount()

public int getPathCount()

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Returns
TypeDescription
int

getPathList()

public List<Key.PathElement> getPathList()

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Returns
TypeDescription
List<PathElement>

getPathOrBuilder(int index)

public Key.PathElementOrBuilder getPathOrBuilder(int index)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Key.PathElementOrBuilder

getPathOrBuilderList()

public List<? extends Key.PathElementOrBuilder> getPathOrBuilderList()

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Returns
TypeDescription
List<? extends com.google.events.cloud.datastore.v1.Key.PathElementOrBuilder>

hasPartitionId()

public boolean hasPartitionId()

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Returns
TypeDescription
boolean

Whether the partitionId field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Key other)

public Key.Builder mergeFrom(Key other)
Parameter
NameDescription
otherKey
Returns
TypeDescription
Key.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Key.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Key.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Key.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Key.Builder
Overrides

mergePartitionId(PartitionId value)

public Key.Builder mergePartitionId(PartitionId value)

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Parameter
NameDescription
valuePartitionId
Returns
TypeDescription
Key.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Key.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Key.Builder
Overrides

removePath(int index)

public Key.Builder removePath(int index)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Key.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Key.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Key.Builder
Overrides

setPartitionId(PartitionId value)

public Key.Builder setPartitionId(PartitionId value)

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Parameter
NameDescription
valuePartitionId
Returns
TypeDescription
Key.Builder

setPartitionId(PartitionId.Builder builderForValue)

public Key.Builder setPartitionId(PartitionId.Builder builderForValue)

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

.google.events.cloud.datastore.v1.PartitionId partition_id = 1;

Parameter
NameDescription
builderForValuePartitionId.Builder
Returns
TypeDescription
Key.Builder

setPath(int index, Key.PathElement value)

public Key.Builder setPath(int index, Key.PathElement value)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameters
NameDescription
indexint
valueKey.PathElement
Returns
TypeDescription
Key.Builder

setPath(int index, Key.PathElement.Builder builderForValue)

public Key.Builder setPath(int index, Key.PathElement.Builder builderForValue)

The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity, the second element identifies a child of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors. An entity path is always fully complete: all of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of Mutation.insert may have no identifier. A path can never be empty, and a path can have at most 100 elements.

repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;

Parameters
NameDescription
indexint
builderForValueKey.PathElement.Builder
Returns
TypeDescription
Key.Builder

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

public Key.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Key.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Key.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Key.Builder
Overrides