I’m new with Java and I’m trying to transform my arraylist to pivot like table using Java 8 version.
I’m trying to transform arraylist from
[ { "Reference": "STEPHEN-CL-ASSIGN-Q1-2018-2019-001", "ClassificationName":"ASSIGNMENT", "GroupName":"Group 1", "GroupShare":"100", "CompetencyName":"CL Long Test", "Score": 10 }, { "Reference": "STEPHEN-CL-ASSIGN-Q1-2018-2019-001", "ClassificationName":"ASSIGNMENT", "GroupName":"Group 1", "GroupShare":"100", "CompetencyName":"Recitation", "Score": 7 }, { "Reference": "STEPHEN-CL-ASSIGN-Q1-2018-2019-001", "ClassificationName":"ASSIGNMENT", "GroupName":"Group 1", "GroupShare":"100", "CompetencyName":"Seatwork and Assignment", "Score": 8 }, { "Reference": "STEPHEN-CL-ASSIGN-Q1-2018-2019-001", "ClassificationName":"ASSIGNMENT", "GroupName":"Group 1", "GroupShare":"100", "CompetencyName":"Quarter Exam", "Score": 8 }, { "Reference": "STEPHEN-CL-ASSIGN-Q1-2018-2019-001", "ClassificationName":"ASSIGNMENT", "GroupName":"Group 1", "GroupShare":"100", "CompetencyName":"CL Quiz", "Score": 10 }, { "Reference": "STEPHEN-CL-QEXAM-Q1-2018-2019-001", "ClassificationName":"QUARTER EXAM", "GroupName":"Group 1", "GroupShare":"100", "CompetencyName":"Quarter Exam", "Score":9 } ]
To
[ { "Reference":"STEPHEN-CL-ASSIGN-Q1-2018-2019-001", "ClassificationName":"ASSIGNMENT", "GroupName":"Group 1", "GroupShare":"100", "CL Long Test": 10, "Recitation": 7, "Seatwork and Assignment": 8, "Quarter Exam": 8, "CL Quiz": 10, "Total": 43 }, { "Reference":"STEPHEN-CL-QEXAM-Q1-2018-2019-001", "ClassificationName":"QUARTER EXAM", "GroupName":"Group 1", "GroupShare":"100", "CL Long Test": 0, "Recitation": 0, "Seatwork and Assignment": 0, "Quarter Exam": 9, "CL Quiz": 0, "Total": 9 } ]
Melanie Pelayo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.