QoraKey class

Immutable query key with validation and type safety.

Supports two usage patterns:

Pattern 1: Direct List (frictionless)

client.fetch(key: ['user', 123], ...);

Pattern 2: Typed Wrapper (safe)

client.fetch(key: QoraKey.withId('user', 123), ...);

Validation Rules:

  • Only primitives (int, String, bool, double, null), List, or Map allowed
  • Custom objects MUST override operator == and hashCode
  • Keys are deeply immutable (defensive copy)
Annotations
  • @immutable

Constructors

QoraKey(List parts)
Creates a key from parts with validation.
const
QoraKey.from(QoraKeyParts parts)
Creates a key from raw parts (conversion helper).
factory
QoraKey.single(String key)
Creates a single-part key.
QoraKey.withFilter(String entity, Map<String, dynamic> filter)
Creates a key with entity and filter map.
QoraKey.withId(String entity, dynamic id)
Creates a key with entity and ID.

Properties

hashCode int
The hash code for this object.
no setteroverride
parts List
The internal parts of the 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