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 13, 2023
1 parent e34e5db commit 66c0b9f
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 66c0b9f

Please sign in to comment.