本文整理了Java中io.vavr.collection.HashMap.map()
方法的一些代码示例,展示了HashMap.map()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashMap.map()
方法的具体详情如下:
包路径:io.vavr.collection.HashMap
类名称:HashMap
方法名:map
暂无
代码示例来源:origin: vavr-io/vavr
@Override
public <V2> HashMap<K, V2> mapValues(Function<? super V, ? extends V2> valueMapper) {
Objects.requireNonNull(valueMapper, "valueMapper is null");
return map((k, v) -> Tuple.of(k, valueMapper.apply(v)));
}
代码示例来源:origin: vavr-io/vavr
@Override
public <K2> HashMap<K2, V> mapKeys(Function<? super K, ? extends K2> keyMapper) {
Objects.requireNonNull(keyMapper, "keyMapper is null");
return map((k, v) -> Tuple.of(keyMapper.apply(k), v));
}
代码示例来源:origin: apache/incubator-pinot
@Override
public io.vavr.collection.Map<String, ?> unhandleChildKeys(Map<String, Map<String, String>> value,
String pathPrefix) {
HashMap<String, String> retVal = HashMap.ofAll(value).flatMap((taskKey, configs) -> {
if (!configs.isEmpty()) {
return HashMap.ofAll(configs).map((configKey, configValue) -> Tuple.of(taskKey + "." + configKey, configValue));
} else {
return HashMap.of(taskKey, "");
}
});
return retVal;
}
}
代码示例来源:origin: io.vavr/vavr
@Override
public <V2> HashMap<K, V2> mapValues(Function<? super V, ? extends V2> valueMapper) {
Objects.requireNonNull(valueMapper, "valueMapper is null");
return map((k, v) -> Tuple.of(k, valueMapper.apply(v)));
}
代码示例来源:origin: io.vavr/vavr
@Override
public <K2> HashMap<K2, V> mapKeys(Function<? super K, ? extends K2> keyMapper) {
Objects.requireNonNull(keyMapper, "keyMapper is null");
return map((k, v) -> Tuple.of(keyMapper.apply(k), v));
}
代码示例来源:origin: daggerok/spring-5-examples
@Bean
InitializingBean initDB() {
return () -> HashMap.of(123, "ololo",
456, "trololo")
.map((orderNumber, description) -> Tuple.of(BigDecimal.valueOf(orderNumber * System.currentTimeMillis() / 1234567890.987654321),
singletonList(description)))
.map(t -> Order.of(OrderNumber.of(t._1().intValue()), Price.of(t._1())))
.forEach(orderRepository::save);
}
}
内容来源于网络,如有侵权,请联系作者删除!