Skip to content

Use Jsonable.fromString() in ConnectionState for consistency#611

Merged
dragonmantank merged 2 commits intodevx-10296-list-video-connectionsfrom
copilot/sub-pr-610
Feb 20, 2026
Merged

Use Jsonable.fromString() in ConnectionState for consistency#611
dragonmantank merged 2 commits intodevx-10296-list-video-connectionsfrom
copilot/sub-pr-610

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 20, 2026

ConnectionState.fromString() used a custom implementation while other enums in the video package (BroadcastStatus, ArchiveStatus, VideoType) consistently use Jsonable.fromString().

Changes

  • Replace custom valueOf(state.toUpperCase()) logic with Jsonable.fromString(value, ConnectionState.class)
  • Add Jsonable import
  • Update method parameter name from state to value to match convention
  • Add Javadoc matching pattern used in other video enums
// Before
@JsonCreator
public static ConnectionState fromString(String state) {
    if (state == null) return null;
    try {
        return ConnectionState.valueOf(state.toUpperCase());
    }
    catch (IllegalArgumentException ex) {
        return null;
    }
}

// After
@JsonCreator
public static ConnectionState fromString(String value) {
    return Jsonable.fromString(value, ConnectionState.class);
}

Functionality is preserved - both implementations handle null, case conversion, and invalid values identically.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: dragonmantank <108948+dragonmantank@users.noreply.github.com>
Copilot AI changed the title [WIP] Update list connections response based on feedback Use Jsonable.fromString() in ConnectionState for consistency Feb 20, 2026
Copilot AI requested a review from dragonmantank February 20, 2026 20:18
@dragonmantank dragonmantank marked this pull request as ready for review February 20, 2026 20:21
@dragonmantank dragonmantank merged commit 8e6ff65 into devx-10296-list-video-connections Feb 20, 2026
14 checks passed
@dragonmantank dragonmantank deleted the copilot/sub-pr-610 branch February 20, 2026 20:23
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.93%. Comparing base (512e04c) to head (a3e3e2d).

Additional details and impacted files
@@                           Coverage Diff                           @@
##             devx-10296-list-video-connections     #611      +/-   ##
=======================================================================
+ Coverage                                98.90%   98.93%   +0.03%     
  Complexity                                3622     3622              
=======================================================================
  Files                                      545      545              
  Lines                                     8007     8004       -3     
  Branches                                   443      443              
=======================================================================
  Hits                                      7919     7919              
+ Misses                                      66       64       -2     
+ Partials                                    22       21       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants