if (vp.hasVehicle() && vp.getVehicle().hasId()) { && update.vehiclePosition.hasVehicle() && update.vehiclePosition.getVehicle().hasId()) { vehicleId = getVehicleId(update.vehiclePosition);
if (!gtfsMetadata.getStopIds().contains(v.getStopId())) { String prefix = (v.hasVehicle() && v.getVehicle().hasId() ? "vehicle_id " + v.getVehicle().getId() + " " : "") + "stop_id " + v.getStopId(); RuleUtils.addOccurrence(E011, prefix, e011List, _log); if (locationType != null && locationType != 0) { String prefix = (v.hasVehicle() && v.getVehicle().hasId() ? "vehicle_id " + v.getVehicle().getId() + " " : "") + "stop_id " + v.getStopId(); RuleUtils.addOccurrence(E015, prefix, e015List, _log);
if (entity.getVehicle().hasVehicle()) { VehicleDescriptor vd = entity.getVehicle().getVehicle(); if (vd.hasId()) {
mergeTrip(other.getTrip()); if (other.hasVehicle()) { mergeVehicle(other.getVehicle());
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (hasTrip()) { if (!getTrip().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasVehicle()) { if (!getVehicle().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasPosition()) { if (!getPosition().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (!extensionsAreInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
/** * Returns the vehicleID. If vehicle ID not available then returns vehicle * label. Returns null if no VehicleDescription associated with the vehicle * or if no ID or label associated with the VehicleDescription. * * @param vehicle * @return vehicle ID or label or null if there isn't one */ private static String getVehicleId(VehiclePosition vehicle) { if (!vehicle.hasVehicle()) { return null; } VehicleDescriptor desc = vehicle.getVehicle(); // Return vehicle ID if there is one if (desc.hasId()) return desc.getId(); // No vehicle ID so return vehicle label if there is one if (desc.hasLabel()) return desc.getLabel(); // No ID nor label so return null return null; }
/** * Returns the vehicleID. Returns null if no VehicleDescription associated * with the vehicle or if no ID associated with the VehicleDescription. * * @param vehicle * @return vehicle ID or null if there isn't one */ private static String getLicensePlate(VehiclePosition vehicle) { if (!vehicle.hasVehicle()) { return null; } VehicleDescriptor desc = vehicle.getVehicle(); if (!desc.hasLicensePlate()) { return null; } return desc.getLicensePlate(); }
/** * @param vehicle * @return */ private String getVehicleId(VehiclePosition vehicle) { if (!vehicle.hasVehicle()) { return null; } VehicleDescriptor desc = vehicle.getVehicle(); if (!desc.hasId()) { return null; } return desc.getId(); }
/** * Returns the vehicle id for the given VehiclePosition if one exists, if not the entity ID is returned in the format * "vehicle.id 1234" or "entity ID 4321". * * @param entity the entity that the VehiclePosition belongs to * @param vehiclePosition the VehiclePosition to get the ID for * @return the vehicle.id for the given VehiclePosition if one exists, if not the entity ID is returned in the format "vehicle.id 1234" or "entity ID 4321". */ public static String getVehicleId(GtfsRealtime.FeedEntity entity, GtfsRealtime.VehiclePosition vehiclePosition) { if (!vehiclePosition.hasVehicle()) { return "entity ID " + entity.getId(); } return getVehicleId(entity, vehiclePosition.getVehicle()); }
/** * Returns true if this vehiclePosition has a vehicle ID, false if it does not * * @param vehiclePosition to examine * @return true if this vehiclePosition has a vehicle ID, false if it does not */ private boolean hasVehicleId(GtfsRealtime.VehiclePosition vehiclePosition) { return vehiclePosition.hasVehicle() && vehiclePosition.getVehicle().hasId(); }
private String getVehicleId(VehiclePosition vp) { if (_useLabelAsVehicleId && vp.hasVehicle() && vp.getVehicle().hasLabel()) return vp.getVehicle().getLabel(); return vp.getVehicle().getId(); }
mergeTrip(other.getTrip()); if (other.hasVehicle()) { mergeVehicle(other.getVehicle());
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (hasTrip()) { if (!getTrip().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasVehicle()) { if (!getVehicle().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasPosition()) { if (!getPosition().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (!extensionsAreInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }