NodeKey class

A validated /-joined path addressing a keyed collection entry.

NodeKey is an additive, optional wire-stable address: unlike the volatile NodeId (a producer may re-mint it after a resync or a remove-then-readd), a key is producer-defined and stable across NodeId churn, so a peer can subscribe to "entry scores/alice" without an out-of-band key→NodeId map. Multi-segment paths address nested collections.

Bounds (protocol.md § NodeKey), enforced on construction:

  • path ≤ 1024 bytes (UTF-8);
  • ≤ 32 /-separated segments;
  • no empty path and no empty segments (leading/trailing/double / rejected).

Serialization is format-aware: the JSON codec omits the key field when this is null, so pre-key encoders and existing conformance fixtures round-trip unchanged.

Constructors

NodeKey(String path)

Properties

hashCode int
The hash code for this object.
no setteroverride
path String
The canonical path string.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
segments List<String>
The /-separated path segments.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
toWire() String
Serialize as a bare path string (the JSON shape of a NodeKey).

Operators

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

Static Methods

fromWire(Object? value) NodeKey
Parse a wire path string, re-validating the bounds.