io.vavr.collection.HashMap.toJavaMap()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中io.vavr.collection.HashMap.toJavaMap()方法的一些代码示例,展示了HashMap.toJavaMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashMap.toJavaMap()方法的具体详情如下:
包路径:io.vavr.collection.HashMap
类名称:HashMap
方法名:toJavaMap

HashMap.toJavaMap介绍

暂无

代码示例

代码示例来源:origin: vavr-io/vavr

@Override
public java.util.HashMap<K, V> toJavaMap() {
  return toJavaMap(java.util.HashMap::new, t -> t);
}

代码示例来源:origin: io.vavr/vavr

@Override
public java.util.HashMap<K, V> toJavaMap() {
  return toJavaMap(java.util.HashMap::new, t -> t);
}

代码示例来源:origin: daggerok/spring-5-examples

"page", request.queryParam("page").orElse("0"),
  "per_page", request.queryParam("size").orElse("3")
).toJavaMap()

代码示例来源:origin: vavr-io/vavr-jackson

@Test
public void testWithOption() throws Exception {
  verifySerialization(typeReferenceWithOption(), List.of(
      Tuple.of(emptyMap().put("1", Option.some(1)), genJsonMap(HashMap.of("1", 1).toJavaMap())),
      Tuple.of(emptyMap().put("1", Option.none()), genJsonMap(HashMap.of("1", null).toJavaMap()))
  ));
}

代码示例来源:origin: org.janusgraph/janusgraph-cql

Session initializeSession(final String keyspaceName) {
  final Session s = this.cluster.connect();
  // if the keyspace already exists, just return the session
  if (this.cluster.getMetadata().getKeyspace(keyspaceName) != null) {
    return s;
  }
  final Configuration configuration = getStorageConfig();
  // Setting replication strategy based on value reading from the configuration: either "SimpleStrategy" or "NetworkTopologyStrategy"
  final Map<String, Object> replication = Match(configuration.get(REPLICATION_STRATEGY)).of(
    Case($("SimpleStrategy"), strategy -> HashMap.<String, Object> of("class", strategy, "replication_factor", configuration.get(REPLICATION_FACTOR))),
    Case($("NetworkTopologyStrategy"),
      strategy -> HashMap.<String, Object> of("class", strategy)
        .merge(Array.of(configuration.get(REPLICATION_OPTIONS))
          .grouped(2)
          .toMap(array -> Tuple.of(array.get(0), Integer.parseInt(array.get(1)))))))
    .toJavaMap();
  s.execute(createKeyspace(keyspaceName)
      .ifNotExists()
      .with()
      .replication(replication));
  return s;
}

代码示例来源:origin: vavr-io/vavr-jackson

@Test
  public void testWithOption() throws Exception {
    Multimap<String, Option<Integer>> multimap = this.<String, Option<Integer>>emptyMap().put("1", Option.some(1)).put("1", Option.none());
    String json = genJsonMap(HashMap.of("1", asList(1, null)).toJavaMap());

    verifySerialization(typeReferenceWithOption(), io.vavr.collection.List.of(Tuple.of(multimap, json)));
  }
}

相关文章