Skip to content

Commit

Permalink
Add Results.idToStateMap and .findStateById
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Feb 8, 2025
1 parent f88224f commit b9cdfac
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ class ServiceConnectionTester(
) : TestState()
}

class Results(
val states: Map<Service, TestState>,
)
class Results internal constructor(
internal val states: Map<Service, TestState>,
) {
val idToStateMap: Map<String, TestState> by lazy { states.mapKeys { it.key.id } }

fun findStateById(id: String): TestState? = states.keys.find { it.id == id }?.let { states[it] }
}

private class ServiceImpl(
val service: Service,
Expand Down

0 comments on commit b9cdfac

Please sign in to comment.