static List<Item> fromArray(Json.JArray items) { return Collections.unmodifiableList( items.getListAsObjects() .map(Item::new) .toJavaList() ); }
static List<Query> fromArray(Json.JArray queries) { return Collections.unmodifiableList( queries.getListAsObjects() .map(Query::new) .toJavaList() ); }
public static List<Property> fromData(Json.JArray data) { return unmodifiableList(data.getListAsObjects() .map(Property::new) .toJavaList()); }
static List<Link> fromArray(Json.JArray node) { return node.getListAsObjects().map(Link::new).toJavaList(); } }
.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));
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);
.map(tuple -> javaslang.Tuple.of(tuple.v1(), tuple.v2())) .toJavaList();
@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); }
/** * 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); }
required_by_name.keySet().diff(by_name.keySet()); error_x = error_x.appendAll( missing.toList().map(SMFSchemaValidator::errorMissingAttribute)); return error_x;