fromWire static method

Priority fromWire(
  1. int raw
)

Decodes a zenoh-c wire priority value (1–7) into a Priority.

The wire domain is 1..7, mapped to the 7 members via raw - 1. Any out-of-range value falls back to Priority.data (Z_PRIORITY_DEFAULT) rather than crashing on an unbounded index.

Implementation

static Priority fromWire(int raw) {
  final index = raw - 1;
  if (index < 0 || index >= Priority.values.length) return Priority.data;
  return Priority.values[index];
}