Class Discriminator
- Namespace
- Kuestenlogik.Bowire.Semantics
- Assembly
- Kuestenlogik.Bowire.dll
Declaration of how a method's message-type discriminator is read off the wire. Companion to MessageType: the discriminator says "look here to find which shape this frame is," then the resolver looks up annotations keyed by that shape.
public sealed record Discriminator : IEquatable<Discriminator>
- Inheritance
-
Discriminator
- Implements
- Inherited Members
Remarks
Four flavours are supported (Phase 1 stores them, later phases read them):
-
WirePath — a byte-offset expression
evaluated against the raw frame before JSON decode (e.g.
byte[1]for the DIS PDU type byte). -
JsonPath — a JSONPath expression
evaluated after decode (e.g.
$.typefor envelope-tagged MQTT / WebSocket payloads). -
Oneof — name of a protobuf
oneofgroup. - None — explicit "method is single-type" marker; every frame keys under Wildcard.
Constructors
Discriminator(string, string)
Declaration of how a method's message-type discriminator is read off the wire. Companion to MessageType: the discriminator says "look here to find which shape this frame is," then the resolver looks up annotations keyed by that shape.
public Discriminator(string Kind, string Value)
Parameters
KindstringWhich flavour the
Valueshould be interpreted as. One of the constants in DiscriminatorKinds.ValuestringKind-dependent payload. For WirePath it is the byte-offset expression; for JsonPath the JSONPath; for Oneof the oneof group name; for None the empty string.
Remarks
Four flavours are supported (Phase 1 stores them, later phases read them):
-
WirePath — a byte-offset expression
evaluated against the raw frame before JSON decode (e.g.
byte[1]for the DIS PDU type byte). -
JsonPath — a JSONPath expression
evaluated after decode (e.g.
$.typefor envelope-tagged MQTT / WebSocket payloads). -
Oneof — name of a protobuf
oneofgroup. - None — explicit "method is single-type" marker; every frame keys under Wildcard.
Properties
IsNone
True when this is the None marker.
public bool IsNone { get; }
Property Value
Kind
Which flavour the Value should be interpreted as.
One of the constants in DiscriminatorKinds.
public string Kind { get; init; }
Property Value
None
Singleton marker for "this method is single-type." Every frame resolves to Wildcard.
public static Discriminator None { get; }
Property Value
Value
Kind-dependent payload. For WirePath it is the byte-offset expression; for JsonPath the JSONPath; for Oneof the oneof group name; for None the empty string.
public string Value { get; init; }
Property Value
Methods
Deconstruct(out string, out string)
public void Deconstruct(out string Kind, out string Value)
Parameters
Equals(Discriminator?)
public bool Equals(Discriminator? other)
Parameters
otherDiscriminator
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(Discriminator?, Discriminator?)
public static bool operator ==(Discriminator? left, Discriminator? right)
Parameters
leftDiscriminatorrightDiscriminator
Returns
operator !=(Discriminator?, Discriminator?)
public static bool operator !=(Discriminator? left, Discriminator? right)
Parameters
leftDiscriminatorrightDiscriminator