Skip to content

refactor: use Map<EdgeType, List<edge>> in GraphStats constructor#96

Open
sauravbhattacharya001 wants to merge 1 commit intomasterfrom
gardener/refactor-graph-stats-constructor
Open

refactor: use Map<EdgeType, List<edge>> in GraphStats constructor#96
sauravbhattacharya001 wants to merge 1 commit intomasterfrom
gardener/refactor-graph-stats-constructor

Conversation

@sauravbhattacharya001
Copy link
Owner

Summary

Replace the 5-parameter positional edge list constructor with a \Map<EdgeType, List>\ variant.

Changes

  • New primary constructor: \GraphStats(Graph, Map<EdgeType, List>)\
  • Old constructor marked @deprecated\ for backward compatibility
  • Added \getEdges(EdgeType)\ accessor for type-safe edge queries
  • Uses \EnumMap\ for efficient edge type lookup

Why

The old constructor had 5 positional \List\ parameters — easy to mix up and requires signature changes whenever a new edge type is added. The map-based constructor is extensible and self-documenting.

🤖 Automated gardening by Zalenix

Replace the 5-parameter positional edge list constructor with a
Map<EdgeType, List<edge>> variant. The old constructor is preserved
as @deprecated for backward compatibility. Adds getEdges(EdgeType)
accessor for type-safe edge queries.

This makes the API cleaner and future-proof — adding a new edge
type no longer requires changing the constructor signature.
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions bot added visualization Graph visualization and UI size/m labels Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant