involvesNode method

bool involvesNode(
  1. String nodeId
)

Checks if this connection involves the given node.

Returns true if the node is either the source or target of this connection.

Parameters:

  • nodeId: The ID of the node to check

Returns: true if nodeId matches either sourceNodeId or targetNodeId

Implementation

bool involvesNode(String nodeId) {
  return sourceNodeId == nodeId || targetNodeId == nodeId;
}