Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Ioannis Angelis
Added: Sep 14, 2021 5:27 PM
Views: 159
Tags: iterate tuple
  1. List<ForecastTableData> fps = new ArrayList<>();
  2.         for (Tuple item : results) {
  3.             ForecastTableData ftd = new ForecastTableData();
  4.             City c = item.get(0, City.class);
  5.             Forecast f = item.get(1, Forecast.class);
  6.             ftd.setCity(c.getCity());
  7.             ftd.setCloud(f.getCloud());
  8.             ftd.setCweather(f.getCweather());
  9.             ForecastTableDataPK k = new ForecastTableDataPK();
  10.             k.setId(f.getForecastPK().getId());
  11.             k.setDt(f.getForecastPK().getDt());
  12.             ftd.setForecastTableDataPK(k);
  13.             ftd.setRain(f.getRain());
  14.             ftd.setSnow(f.getSnow());
  15.             ftd.setTemp(f.getTemp());
  16.             ftd.setWind(f.getWind());
  17.             fps.add(ftd);
  18.         }