StreamSupport.stream(interpolatedStopTimesForTrip.spliterator(), false).mapToInt(stopTime -> stopTime.stop_sequence).max().orElse(0) ) + 1; stopTimeUpdateListWithSentinel.add(GtfsRealtime.TripUpdate.StopTimeUpdate.newBuilder().setStopSequence(stopSequenceCeiling).setScheduleRelationship(NO_DATA).build()); for (GtfsRealtime.TripUpdate.StopTimeUpdate stopTimeUpdate : stopTimeUpdateListWithSentinel) { int nextStopSequence = stopTimes.isEmpty() ? 1 : stopTimes.get(stopTimes.size()-1).stop_sequence+1;
/** * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code> */ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder getArrivalBuilder() { bitField0_ |= 0x00000004; onChanged(); return getArrivalFieldBuilder().getBuilder(); } /**
stopTimeUpdate.setStopId(AgencyAndId.convertToString(tpr.getTimepointId())); stopTimeUpdate.setScheduleRelationship(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.SCHEDULED); stopTimeUpdate.setArrival(arrivalStopTimeEvent); StopTimeEvent.Builder departureStopTimeEvent = StopTimeEvent.newBuilder(); departureStopTimeEvent.setTime(tpr.getTimepointPredictedDepartureTime()); stopTimeUpdate.setDeparture(departureStopTimeEvent); stopTimeUpdate.setStopId(AgencyAndId.convertToString(stop.getId())); stopTimeUpdate.setStopSequence(nextStopTime.getSequence()); stopTimeUpdate.setScheduleRelationship(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.ScheduleRelationship.SCHEDULED); stopTimeUpdate.setDeparture(stopTimeEvent);
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate other) { if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance()) return this; if (other.hasStopSequence()) { setStopSequence(other.getStopSequence()); } if (other.hasStopId()) { bitField0_ |= 0x00000002; stopId_ = other.stopId_; onChanged(); } if (other.hasArrival()) { mergeArrival(other.getArrival()); } if (other.hasDeparture()) { mergeDeparture(other.getDeparture()); } if (other.hasScheduleRelationship()) { setScheduleRelationship(other.getScheduleRelationship()); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (hasArrival()) { if (!getArrival().isInitialized()) { return false; } } if (hasDeparture()) { if (!getDeparture().isInitialized()) { return false; } } if (!extensionsAreInitialized()) { return false; } return true; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
private static Builder create() { return new Builder(); }
/** * <code>optional .transit_realtime.TripUpdate.StopTimeEvent arrival = 2;</code> */ public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeEvent.Builder getArrivalBuilder() { bitField0_ |= 0x00000004; onChanged(); return getArrivalFieldBuilder().getBuilder(); } /**
public com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate build() { com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getArrivalFieldBuilder(); getDepartureFieldBuilder(); } } private static Builder create() {
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate other) { if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance()) return this; if (other.hasStopSequence()) { setStopSequence(other.getStopSequence()); } if (other.hasStopId()) { bitField0_ |= 0x00000002; stopId_ = other.stopId_; onChanged(); } if (other.hasArrival()) { mergeArrival(other.getArrival()); } if (other.hasDeparture()) { mergeDeparture(other.getDeparture()); } if (other.hasScheduleRelationship()) { setScheduleRelationship(other.getScheduleRelationship()); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (hasArrival()) { if (!getArrival().isInitialized()) { return false; } } if (hasDeparture()) { if (!getDeparture().isInitialized()) { return false; } } if (!extensionsAreInitialized()) { return false; } return true; }
public Builder clone() { return create().mergeFrom(buildPartial()); }