Class Key.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
com.google.datastore.v1.Key.Builder
All Implemented Interfaces:
KeyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Key

public static final class Key.Builder extends com.google.protobuf.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.datastore.v1.Key
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • clear

      public Key.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • getDefaultInstanceForType

      public Key getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Key build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Key buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public Key.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • setField

      public Key.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • clearField

      public Key.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • clearOneof

      public Key.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • setRepeatedField

      public Key.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • addRepeatedField

      public Key.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • mergeFrom

      public Key.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Key.Builder>
    • mergeFrom

      public Key.Builder mergeFrom(Key other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • mergeFrom

      public Key.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Key.Builder>
      Throws:
      IOException
    • 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.datastore.v1.PartitionId partition_id = 1;
      Specified by:
      hasPartitionId in interface KeyOrBuilder
      Returns:
      Whether the partitionId field is set.
    • 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.datastore.v1.PartitionId partition_id = 1;
      Specified by:
      getPartitionId in interface KeyOrBuilder
      Returns:
      The partitionId.
    • setPartitionId

      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.datastore.v1.PartitionId partition_id = 1;
    • setPartitionId

      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.datastore.v1.PartitionId partition_id = 1;
    • mergePartitionId

      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.datastore.v1.PartitionId partition_id = 1;
    • 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.datastore.v1.PartitionId partition_id = 1;
    • 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.datastore.v1.PartitionId partition_id = 1;
    • 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.datastore.v1.PartitionId partition_id = 1;
      Specified by:
      getPartitionIdOrBuilder in interface KeyOrBuilder
    • 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.datastore.v1.Key.PathElement path = 2;
      Specified by:
      getPathList in interface KeyOrBuilder
    • 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.datastore.v1.Key.PathElement path = 2;
      Specified by:
      getPathCount in interface KeyOrBuilder
    • getPath

      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.datastore.v1.Key.PathElement path = 2;
      Specified by:
      getPath in interface KeyOrBuilder
    • setPath

      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.datastore.v1.Key.PathElement path = 2;
    • setPath

      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.datastore.v1.Key.PathElement path = 2;
    • addPath

      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.datastore.v1.Key.PathElement path = 2;
    • addPath

      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.datastore.v1.Key.PathElement path = 2;
    • addPath

      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.datastore.v1.Key.PathElement path = 2;
    • addPath

      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.datastore.v1.Key.PathElement path = 2;
    • addAllPath

      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.datastore.v1.Key.PathElement path = 2;
    • 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.datastore.v1.Key.PathElement path = 2;
    • removePath

      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.datastore.v1.Key.PathElement path = 2;
    • getPathBuilder

      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.datastore.v1.Key.PathElement path = 2;
    • getPathOrBuilder

      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.datastore.v1.Key.PathElement path = 2;
      Specified by:
      getPathOrBuilder in interface KeyOrBuilder
    • 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.datastore.v1.Key.PathElement path = 2;
      Specified by:
      getPathOrBuilderList in interface KeyOrBuilder
    • 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.datastore.v1.Key.PathElement path = 2;
    • addPathBuilder

      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.datastore.v1.Key.PathElement path = 2;
    • 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.datastore.v1.Key.PathElement path = 2;
    • setUnknownFields

      public final Key.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>
    • mergeUnknownFields

      public final Key.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Key.Builder>