Untitled
unknown
java
17 days ago
583 B
3
Indexable
Never
// Assume List<MerchantVa> result already contains the data List<Map<String, String>> simplifiedData = result.stream() .map(merchantVa -> { Map<String, String> vaPrefixMap = new HashMap<>(); vaPrefixMap.put("va", merchantVa.getVa()); vaPrefixMap.put("prefix", merchantVa.getPrefix()); return vaPrefixMap; }) .collect(Collectors.toList()); // Now you can iterate over the simplified data for (Map<String, String> item : simplifiedData) { System.out.println("VA: " + item.get("va") + ", Prefix: " + item.get("prefix")); }
Leave a Comment