javaslang.collection.List.map()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(121)

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

List.map介绍

暂无

代码示例

代码示例来源:origin: hamnis/json-collection

static List<Item> fromArray(Json.JArray items) {
  return Collections.unmodifiableList(
      items.getListAsObjects()
          .map(Item::new)
          .toJavaList()
  );
}

代码示例来源:origin: hamnis/json-collection

static List<Query> fromArray(Json.JArray queries) {
  return Collections.unmodifiableList(
      queries.getListAsObjects()
      .map(Query::new)
      .toJavaList()
  );
}

代码示例来源:origin: hamnis/json-collection

public static List<Property> fromData(Json.JArray data) {
  return unmodifiableList(data.getListAsObjects()
      .map(Property::new)
      .toJavaList());
}

代码示例来源:origin: hamnis/json-collection

static List<Link> fromArray(Json.JArray node) {
    return node.getListAsObjects().map(Link::new).toJavaList();
  }
}

代码示例来源:origin: dswarm/dswarm

.filter(mappingOutputTuple -> mappingOutputTuple._1.isPresent())
.map(mappingOutputTuple -> Tuple.of(mappingOutputTuple._1.get(), mappingOutputTuple._2, mappingOutputTuple._5))
.sortBy(mappingOutputTuple -> mappingOutputTuple._1)
.map(mappingOutputTuple -> Tuple.of(mappingOutputTuple._2, mappingOutputTuple._3));

代码示例来源:origin: dswarm/dswarm

final javaslang.collection.List<Component> componentList) {
final javaslang.collection.Map<String, Component> newComponentMap = componentMap.removeAll(components.map(DMPObject::getUuid));
final javaslang.collection.List<Component> newComponentList = componentList.prependAll(components);

代码示例来源:origin: dswarm/dswarm

.map(tuple -> javaslang.Tuple.of(tuple.v1(), tuple.v2()))
.toJavaList();

代码示例来源:origin: hamnis/json-collection

@Override
public Option<Errors> extract(Json.JObject node) {
  Function<Json.JArray, List<Error>> toErrors = arr -> arr.
      getListAsObjects().
      map(factory::createError).
      toJavaList();
  Option<Json.JObject> errors = node.getAsObject("errors");
  return errors.map(
      j -> j.value.map((k, v) -> Tuple.of(k, toErrors.apply(v.asJsonArrayOrEmpty()))).toJavaMap()
  ).map(Errors::new);
}

代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main

.map(e -> SMFProcessingError.of(e.message(), e.exception())));
.map(e -> SMFProcessingError.of(e.message(), e.exception())));

代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main

/**
 * Attempt to parse a command.
 *
 * @param file The file, if any
 * @param line The line
 * @param text The text
 *
 * @return A parsed command or a list of parse errors
 */
public static Validation<List<SMFParseError>, SMFMemoryMeshFilterType> parse(
 final Optional<URI> file,
 final int line,
 final List<String> text)
{
 NullCheck.notNull(file, "file");
 NullCheck.notNull(text, "text");
 if (text.length() >= 1) {
  try {
   return valid(create(text.map(SMFAttributeName::of).toSet()));
  } catch (final IllegalArgumentException e) {
   return errorExpectedGotValidation(file, line, makeSyntax(), text);
  }
 }
 return errorExpectedGotValidation(file, line, makeSyntax(), text);
}

代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.validation.api

required_by_name.keySet().diff(by_name.keySet());
error_x = error_x.appendAll(
 missing.toList().map(SMFSchemaValidator::errorMissingAttribute));
return error_x;

相关文章