Ich habe eine Arraylist von HashMapAuszugswerte aus einer Arraylist von HashMap mit java8
wie kann ich tun mit Java 8 und .map .filter Techniken eine Arraylist von String von einigem Wert in der HashMap bekommen
für exemple
String Daten gleich zu
[{
"schema": [{
"name": "#VALUE",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}, {
"name": "@ref",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}],
"values": [null, 442256]
}, {
"schema": [{
"name": "#VALUE",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}, {
"name": "@ref",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}],
"values": [null, 4192463331]
}, {
"schema": [{
"name": "#VALUE",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}, {
"name": "@ref",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}],
"values": [null, 34817060]
}, {
"schema": [{
"name": "#VALUE",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}, {
"name": "@ref",
"dataType": {},
"nullable": true,
"metadata": {
"map": {}
}
}],
"values": [null, 291594905]
}]
das Ergebnis
["442256","4192463331","34817060","291594905"]
dieser Teil meines Codes aber nicht
Stream.of(mapper.readValue(mapper.writeValueAsString(data),ArrayList.class))
.filter(c -> c instanceof ArrayList<?>)
.map(ArrayList.class::cast)
.map(c ->
c.forEach(f -> { Stream.of(mapper.readValue(mapper.writeValueAsString(f),HashMap.class))
.filter(f -> f instanceof HashMap<?,?>)
.map(HashMap.class::cast)
...
}
)
)
.forEach(System.out::println);
eine Idee zu arbeiten?
herzlich
Sie haben keinen [MCVE] liefern (http://www.stackoverflow.com) –
Bitte senden Sie eine ganze lauffähiger Code –
Erstellen Sie zuerst eine 'List