Skip to content

Commit

Permalink
Rename StorageResourceUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 24, 2023
1 parent 9201841 commit c653a2e
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.stream.Collectors;

/**
* Storage utility class.
* Storage resource utility class.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class StorageResourceUtils {
Expand All @@ -41,11 +41,8 @@ public final class StorageResourceUtils {
* @return storage node data sources
*/
public static Map<StorageNode, DataSource> getStorageNodeDataSources(final Map<String, DataSource> dataSources) {
Map<StorageNode, DataSource> result = new LinkedHashMap<>(dataSources.size(), 1F);
for (Entry<String, DataSource> entry : dataSources.entrySet()) {
result.put(new StorageNode(entry.getKey()), entry.getValue());
}
return result;
return dataSources.entrySet().stream()
.collect(Collectors.toMap(entry -> new StorageNode(entry.getKey()), Entry::getValue, (oldValue, currentValue) -> currentValue, () -> new LinkedHashMap<>(dataSources.size(), 1F)));
}

/**
Expand Down

0 comments on commit c653a2e

Please sign in to comment.