TripEntry trip = blockTrip.getTrip();
TripBean tripBean = _tripBeanService.getTripForId(trip.getId());
if (tripBean == null)
throw new IllegalStateException("unknown trip: " + trip.getId());
BlockTripBean bean = new BlockTripBean();
bean.setTrip(tripBean);
bean.setAccumulatedSlackTime(blockTrip.getAccumulatedSlackTime());
bean.setDistanceAlongBlock(blockTrip.getDistanceAlongBlock());
List<BlockStopTimeBean> blockStopTimes = new ArrayList<BlockStopTimeBean>();
for (BlockStopTimeEntry blockStopTime : blockTrip.getStopTimes()) {
BlockStopTimeBean blockStopTimeAsBean = getBlockStopTimeAsBean(blockStopTime);
blockStopTimes.add(blockStopTimeAsBean);
}
bean.setBlockStopTimes(blockStopTimes);
return bean;
}