esm.setRouteId(es.getRouteId()); if (es.hasRouteType()) { esm.setRouteType(es.getRouteType());
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.EntitySelector other) { if (other == com.google.transit.realtime.GtfsRealtime.EntitySelector.getDefaultInstance()) return this; if (other.hasAgencyId()) { bitField0_ |= 0x00000001; agencyId_ = other.agencyId_; onChanged(); } if (other.hasRouteId()) { bitField0_ |= 0x00000002; routeId_ = other.routeId_; onChanged(); } if (other.hasRouteType()) { setRouteType(other.getRouteType()); } if (other.hasTrip()) { mergeTrip(other.getTrip()); } if (other.hasStopId()) { bitField0_ |= 0x00000010; stopId_ = other.stopId_; onChanged(); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * Checks rule E033 - "Alert informed_entity does not have any specifiers" and adds * any errors that are found to the provided errors list * * @param entity feed entity to examine that contains an alert * @param entitySelector EntitySelector to examine for specifiers * @param errors list to add any errors for E033 to */ private void checkE033(GtfsRealtime.FeedEntity entity, GtfsRealtime.EntitySelector entitySelector, List<OccurrenceModel> errors) { GtfsRealtime.TripDescriptor trip = null; if (entitySelector.hasTrip()) { trip = entitySelector.getTrip(); } if (!entitySelector.hasAgencyId() && !entitySelector.hasRouteId() && !entitySelector.hasRouteType() && !entitySelector.hasStopId()) { // informed_entity isn't populated - check TripDescriptor if (trip == null || (!trip.hasTripId() && !trip.hasRouteId())) { RuleUtils.addOccurrence(E033, "alert ID " + entity.getId() + " informed_entity and informed_entity.trip do not not reference any agency, route, trip, or stop", errors, _log); } } }
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.EntitySelector other) { if (other == com.google.transit.realtime.GtfsRealtime.EntitySelector.getDefaultInstance()) return this; if (other.hasAgencyId()) { bitField0_ |= 0x00000001; agencyId_ = other.agencyId_; onChanged(); } if (other.hasRouteId()) { bitField0_ |= 0x00000002; routeId_ = other.routeId_; onChanged(); } if (other.hasRouteType()) { setRouteType(other.getRouteType()); } if (other.hasTrip()) { mergeTrip(other.getTrip()); } if (other.hasStopId()) { bitField0_ |= 0x00000010; stopId_ = other.stopId_; onChanged(); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }
private String createId(String id, EntitySelector informed) { return id + " " + (informed.hasAgencyId () ? informed.getAgencyId () : " null ") + " " + (informed.hasRouteId () ? informed.getRouteId () : " null ") + " " + (informed.hasTrip() && informed.getTrip().hasDirectionId() ? informed.getTrip().hasDirectionId() : " null ") + " " + (informed.hasRouteType () ? informed.getRouteType () : " null ") + " " + (informed.hasStopId () ? informed.getStopId () : " null ") + " " + (informed.hasTrip() && informed.getTrip().hasTripId() ? informed.getTrip().getTripId() : " null "); }