Skip to content

Hazard group equality and identity

Compares clsHazardGroup instances by identity, using HazardGroupID alone.

Field Value
Operation ID op-16-hazard-group-equality
Trigger Equals/GetHashCode/ToString call
Inputs clsHazardGroup instance(s)
Outputs Boolean / hash / string
Primary components clsHazardGroup.Equals (three overloads), .GetHashCode, .ToString
Entry point SAIF.Business.Policy/clsHazardGroup.vb

Steps

  1. Identity is HazardGroupID alone (BR-POL-003); non-clsHazardGroup operands return False.
  2. ToString returns the id.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["Caller invokes Equals /<br>GetHashCode / ToString"]) --> TypeCheck{Operand is<br>clsHazardGroup?}
    TypeCheck -->|No| ReturnFalse(["Return False"])
    TypeCheck -->|Yes| Identity["Compare/hash based on<br>HazardGroupID alone"]
    Identity --> ToStringCheck{ToString called?}
    ToStringCheck -->|Yes| ReturnId(["Return HazardGroupID<br>as string"])
    ToStringCheck -->|No| ReturnResult(["Return Equals /<br>GetHashCode result"])

Failure and edge-case behavior

  • Non-clsHazardGroup operands passed to Equals return False rather than throwing a type-mismatch exception (BR-POL-003).

Sources

  • SAIF.Business.Policy/clsHazardGroup.vb