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

x33g5p2x  于2022-01-25 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(188)

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

Map.head介绍

暂无

代码示例

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

static <K, V, M extends Map<K, V>> M peek(M map, Consumer<? super Tuple2<K, V>> action) {
  Objects.requireNonNull(action, "action is null");
  if (!map.isEmpty()) {
    action.accept(map.head());
  }
  return map;
}

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

@Override
public Tuple2<K, V> head() {
  final Tuple2<K, Traversable<V>> head = back.head();
  return Tuple.of(head._1, head._2.head());
}

代码示例来源:origin: apache/incubator-pinot

@Override
 public Map<String, ?> unapply(Map<String, ?> childKeys, String pathPrefix) {
  String tableNameWithSuffix = childKeys.filterKeys(key -> key.startsWith("table.name")).head()._2.toString();

  return ((Map<String, Object>) childKeys).filterKeys(key -> !key.startsWith("table.name"))
    .put("table.name", TableNameBuilder.extractRawTableName(tableNameWithSuffix));
 }
}

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

static <K, V, M extends Map<K, V>> M peek(M map, Consumer<? super Tuple2<K, V>> action) {
  Objects.requireNonNull(action, "action is null");
  if (!map.isEmpty()) {
    action.accept(map.head());
  }
  return map;
}

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

@Override
public Tuple2<K, V> head() {
  final Tuple2<K, Traversable<V>> head = back.head();
  return Tuple.of(head._1, head._2.head());
}

相关文章