Class AnnotationKey

Namespace
Kuestenlogik.Bowire.Semantics
Assembly
Kuestenlogik.Bowire.dll

Four-dimensional address of a schema-field annotation: (service, method, message-type, json-path).

public sealed record AnnotationKey : IEquatable<AnnotationKey>
Inheritance
AnnotationKey
Implements
Inherited Members

Remarks

The frame-semantics framework treats every annotation as a tag on a specific field path inside a specific message type inside a specific method on a specific service. Three dimensions are not enough — a single transport channel (DIS multicast, MQTT topic, SignalR hub, protobuf oneof, WebSocket envelope) routinely carries multiple payload shapes, and the same JSON path can mean different things in each. The discriminator dimension keeps those interpretations separate.

For single-type methods (a classical REST GET, a unary gRPC call, …) MessageType is the literal wildcard Wildcard ("*"). The wildcard is a regular value, not a separate case in the resolver — annotations under "*" match by equality just like annotations under "EntityStatePdu".

Constructors

AnnotationKey(string, string, string, string)

Four-dimensional address of a schema-field annotation: (service, method, message-type, json-path).

public AnnotationKey(string ServiceId, string MethodId, string MessageType, string JsonPath)

Parameters

ServiceId string

Plugin-defined service identifier — the OpenAPI tag, gRPC service FQN, SignalR hub name, MQTT topic prefix, … . Always non-null and case-sensitive: two services that differ only in casing are not the same service.

MethodId string

Plugin-defined method identifier within ServiceId — the operationId, gRPC method name, hub-method name, … . Always non-null and case-sensitive.

MessageType string

Discriminator value selecting which shape of message this annotation applies to. Wildcard ("*") for single-type methods; a concrete string for multi-type channels (e.g. "EntityStatePdu", "PortCallScheduled"). Case-sensitive.

JsonPath string

JSONPath expression rooted at the message body ($). The resolver does an exact-string match, so $.position.lat and $.position.lat (with trailing whitespace) are different keys; callers should canonicalise before constructing.

Remarks

The frame-semantics framework treats every annotation as a tag on a specific field path inside a specific message type inside a specific method on a specific service. Three dimensions are not enough — a single transport channel (DIS multicast, MQTT topic, SignalR hub, protobuf oneof, WebSocket envelope) routinely carries multiple payload shapes, and the same JSON path can mean different things in each. The discriminator dimension keeps those interpretations separate.

For single-type methods (a classical REST GET, a unary gRPC call, …) MessageType is the literal wildcard Wildcard ("*"). The wildcard is a regular value, not a separate case in the resolver — annotations under "*" match by equality just like annotations under "EntityStatePdu".

Fields

Wildcard

The literal "*" used for the message-type slot when a method carries a single payload shape (no discriminator).

public const string Wildcard = "*"

Field Value

string

Properties

JsonPath

JSONPath expression rooted at the message body ($). The resolver does an exact-string match, so $.position.lat and $.position.lat (with trailing whitespace) are different keys; callers should canonicalise before constructing.

public string JsonPath { get; init; }

Property Value

string

MessageType

Discriminator value selecting which shape of message this annotation applies to. Wildcard ("*") for single-type methods; a concrete string for multi-type channels (e.g. "EntityStatePdu", "PortCallScheduled"). Case-sensitive.

public string MessageType { get; init; }

Property Value

string

MethodId

Plugin-defined method identifier within ServiceId — the operationId, gRPC method name, hub-method name, … . Always non-null and case-sensitive.

public string MethodId { get; init; }

Property Value

string

ServiceId

Plugin-defined service identifier — the OpenAPI tag, gRPC service FQN, SignalR hub name, MQTT topic prefix, … . Always non-null and case-sensitive: two services that differ only in casing are not the same service.

public string ServiceId { get; init; }

Property Value

string

Methods

Deconstruct(out string, out string, out string, out string)

public void Deconstruct(out string ServiceId, out string MethodId, out string MessageType, out string JsonPath)

Parameters

ServiceId string
MethodId string
MessageType string
JsonPath string

Equals(AnnotationKey?)

public bool Equals(AnnotationKey? other)

Parameters

other AnnotationKey

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

ForSingleType(string, string, string)

Convenience factory for single-type methods — fills the MessageType slot with Wildcard.

public static AnnotationKey ForSingleType(string serviceId, string methodId, string jsonPath)

Parameters

serviceId string
methodId string
jsonPath string

Returns

AnnotationKey

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(AnnotationKey?, AnnotationKey?)

public static bool operator ==(AnnotationKey? left, AnnotationKey? right)

Parameters

left AnnotationKey
right AnnotationKey

Returns

bool

operator !=(AnnotationKey?, AnnotationKey?)

public static bool operator !=(AnnotationKey? left, AnnotationKey? right)

Parameters

left AnnotationKey
right AnnotationKey

Returns

bool