return itinerary;
}
public LegV2Bean getLeg(LegBean leg) {
LegV2Bean bean = new LegV2Bean();
bean.setStartTime(leg.getStartTime());
bean.setEndTime(leg.getEndTime());
bean.setFrom(_factory.getPoint(leg.getFrom()));
bean.setTo(_factory.getPoint(leg.getTo()));
bean.setDistance(leg.getDistance());
bean.setMode(leg.getMode());
TransitLegBean transitLeg = leg.getTransitLeg();
if (transitLeg != null) {
TransitLegV2Bean transitLegBean = getTransitLeg(transitLeg);
bean.setTransitLeg(transitLegBean);
}
List<StreetLegBean> streetLegs = leg.getStreetLegs();
if (!CollectionsLibrary.isEmpty(streetLegs)) {
List<StreetLegV2Bean> streetLegBeans = new ArrayList<StreetLegV2Bean>();
for (StreetLegBean streetLeg : streetLegs) {
StreetLegV2Bean streetLegBean = getStreetLeg(streetLeg);
streetLegBeans.add(streetLegBean);
}
bean.setStreetLegs(streetLegBeans);
}
return bean;
}