Skip to content

Code ⇄ enum translation

Translates policy domain codes to/from strongly-typed enum values with no data access or side effects.

Field Value
Operation ID op-14-code-enum-translation
Trigger Any Enums.Convert* call
Inputs Code string or enum member
Outputs Enum member or code string
Primary components The eleven Enums.Convert* overload pairs
Entry point SAIF.Business.Policy/Enums.vb

Steps

  1. A single Select Case in each direction over private/public code constants.
  2. Unmatched input returns the enum's Unknown/Unassigned member, or "" in the enum→code direction (BR-POL-017).
  3. No data access, no side effects.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["Caller invokes<br>Enums.Convert*"]) --> A{"Direction?"}
    A -->|Code to enum| B["Select Case over<br>code constants"]
    A -->|Enum to code| C["Select Case over<br>enum members"]
    B --> D{"Code matched?"}
    D -->|Yes| E(["Return matching<br>enum member"])
    D -->|No| F(["Return Unknown/<br>Unassigned member"])
    C --> G{"Enum matched?"}
    G -->|Yes| H(["Return matching<br>code string"])
    G -->|No| I(["Return empty string"])

Failure and edge-case behavior

  • Unmatched input returns the enum's Unknown/Unassigned member, or "" in the enum→code direction (BR-POL-017).

Sources

  • SAIF.Business.Policy/Enums.vb