Skip to content

Commit

Permalink
Refactor getting topology IDs
Browse files Browse the repository at this point in the history
Improve the return of this method and conditions to make it more readable.

JIRA: LIGHTY-235
Signed-off-by: tobias.pobocik <[email protected]>
  • Loading branch information
Tobianas committed Sep 22, 2023
1 parent cb72fc9 commit fd8d1cb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public ResponseEntity getAllTopologyIdsOperational(Authentication authentication
tx.read(LogicalDatastoreType.OPERATIONAL, iid).get(TIMEOUT, TimeUnit.SECONDS);

if (readData.isPresent() && readData.get().getTopology() != null) {
final List<String> topology = readData.get().getTopology().values().stream()
final List<String> topology = readData.get().nonnullTopology().values().stream()
.map(topology1 -> topology1.getTopologyId().getValue())
.collect(Collectors.toList());
return ResponseEntity.ok(topology);
Expand Down

0 comments on commit fd8d1cb

Please sign in to comment.