Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static List<TabellaGiornataTariffario> GetListaTariffari( List<Object[]> aaa ) {
- Map<TabellaGiornataTariffario, List<Object[]>> rowsByGiornata = aaa.stream()
- .collect(Collectors.groupingBy(
- row -> new TabellaGiornataTariffario(((BigInteger) row[0]).longValue(), (Date) row[1], (Boolean) row[2], null)));
- return rowsByGiornata.entrySet().stream()
- .map(Test::toGiornataWithTariffarios)
- .collect(Collectors.toList());
- }
- private static TabellaGiornataTariffario toGiornataWithTariffarios(Map.Entry<TabellaGiornataTariffario, List<Object[]>> tabellaGiornataTariffarioListEntry) {
- TabellaGiornataTariffario tabellaGiornataTariffario = tabellaGiornataTariffarioListEntry.getKey();
- List<TabellaTariffario> tabellaTariffarios = tabellaGiornataTariffarioListEntry.getValue().stream()
- .map(row -> new TabellaTariffario(((BigInteger)row[3]).longValue(), (Integer)row[4], (Boolean)row[5], (BigDecimal)row[6], (Double)row[7]))
- .collect(Collectors.toList());
- tabellaGiornataTariffario.setTabellaTariffarioList(tabellaTariffarios);
- return tabellaGiornataTariffario;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement