Key class

A complete or partial key.

A key can uniquely identify a datastore Entitys. It consists of a partition and path. The path consists of one or more KeyElements.

A key may be incomplete. This is usesful when inserting Entitys which IDs should be automatically allocated.

Example of a fully populated Key:

var fullKey = new Key([new KeyElement('Person', 1),
                       new KeyElement('Address', 2)]);

Example of a partially populated Key / an incomplete Key:

var partialKey = new Key([new KeyElement('Person', 1),
                          new KeyElement('Address', null)]);

Constructors

Key(List<KeyElement> elements, {Partition partition = Partition.DEFAULT})
Key.fromParent(String kind, int id, {Key? parent})
factory

Properties

elements List<KeyElement>
The path of KeyElements.
final
hashCode int
The hash code for this object.
no setteroverride
partition Partition
The partition of this Key.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override