Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1.     private static List<TabellaGiornataTariffario> GetListaTariffari( List<Object[]> aaa ) {
  2.  
  3.         Map<TabellaGiornataTariffario, List<Object[]>> rowsByGiornata = aaa.stream()
  4.                 .collect(Collectors.groupingBy(
  5.                         row -> new TabellaGiornataTariffario(((BigInteger) row[0]).longValue(), (Date) row[1], (Boolean) row[2], null)));
  6.  
  7.         return rowsByGiornata.entrySet().stream()
  8.                 .map(Test::toGiornataWithTariffarios)
  9.                 .collect(Collectors.toList());
  10.     }
  11.  
  12.     private static TabellaGiornataTariffario toGiornataWithTariffarios(Map.Entry<TabellaGiornataTariffario, List<Object[]>> tabellaGiornataTariffarioListEntry) {
  13.         TabellaGiornataTariffario tabellaGiornataTariffario = tabellaGiornataTariffarioListEntry.getKey();
  14.         List<TabellaTariffario> tabellaTariffarios = tabellaGiornataTariffarioListEntry.getValue().stream()
  15.                 .map(row -> new TabellaTariffario(((BigInteger)row[3]).longValue(), (Integer)row[4], (Boolean)row[5], (BigDecimal)row[6], (Double)row[7]))
  16.                 .collect(Collectors.toList());
  17.         tabellaGiornataTariffario.setTabellaTariffarioList(tabellaTariffarios);
  18.         return tabellaGiornataTariffario;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement