}
private VehicleLocationRecordBean getVehicleLocationRecordAsBean(
VehicleLocationRecord record) {
VehicleLocationRecordBean bean = new VehicleLocationRecordBean();
bean.setBlockId(AgencyAndIdLibrary.convertToString(record.getBlockId()));
if (record.getPhase() != null)
bean.setPhase(record.getPhase().toLabel());
if (record.isCurrentLocationSet()) {
CoordinatePoint location = new CoordinatePoint(
record.getCurrentLocationLat(), record.getCurrentLocationLon());
bean.setCurrentLocation(location);
}
if (record.isCurrentOrientationSet())
bean.setCurrentOrientation(record.getCurrentOrientation());
if (record.isDistanceAlongBlockSet())
bean.setDistanceAlongBlock(record.getDistanceAlongBlock());
if (record.isScheduleDeviationSet())
bean.setScheduleDeviation(record.getScheduleDeviation());
bean.setStatus(record.getStatus());
bean.setServiceDate(record.getServiceDate());
bean.setTimeOfRecord(record.getTimeOfRecord());
bean.setTripId(AgencyAndIdLibrary.convertToString(record.getTripId()));
bean.setVehicleId(AgencyAndIdLibrary.convertToString(record.getVehicleId()));
return bean;
}