Skip to content

Instantly share code, notes, and snippets.

@mp-singh
Created January 25, 2022 23:01
Show Gist options
  • Save mp-singh/9daef4883525d2cf3da68af5ed96a937 to your computer and use it in GitHub Desktop.
Save mp-singh/9daef4883525d2cf3da68af5ed96a937 to your computer and use it in GitHub Desktop.
example
public static void main(String[] args) {
Map<String, T3Return> map = new HashMap<>();
try (BufferedReader br = new BufferedReader(new FileReader("src/main/resources/sample.csv"))) {
map = br.lines()
.skip(1)
.map(l -> {
String[] record = l.split(",");
return new T3Return(record[0], record[1], record[2], record[3], record[4], record[5]);
})
.filter(Validation::isValidT3Return)
.collect(Collectors.toMap(T3Return::getTan, Function.identity()));
} catch (IOException e) {
e.printStackTrace();
}
map.forEach((s, t3Return) -> System.out.println("entry e:" + s + "->" + t3Return));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment