本文整理了Java中java.util.stream.Collectors.toUnmodifiableMap()
方法的一些代码示例,展示了Collectors.toUnmodifiableMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collectors.toUnmodifiableMap()
方法的具体详情如下:
包路径:java.util.stream.Collectors
类名称:Collectors
方法名:toUnmodifiableMap
暂无
代码示例来源:origin: moditect/deptective
public DeptectiveOptions(String... args) {
if (args != null) {
this.options = Arrays.stream(args)
.map(o -> o.split("="))
.collect(Collectors.toUnmodifiableMap(o -> o[0], o -> o[1]));
}
else {
this.options = Collections.emptyMap();
}
}
代码示例来源:origin: com.github.tornaia/aott-desktop-client-core
public CategorySettings copy() {
CategorySettings categorySettings = new CategorySettings();
categorySettings.categories = List.copyOf(categories);
categorySettings.processToCategoryMap = Map.copyOf(processToCategoryMap);
categorySettings.nodeToCategoryMap = nodeToCategoryMap
.entrySet()
.stream()
.map(e -> new AbstractMap.SimpleImmutableEntry<>(e.getKey(), Map.copyOf(e.getValue())))
.collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue));
return categorySettings;
}
内容来源于网络,如有侵权,请联系作者删除!