Package com.cta4j.bus.prediction.model
Record Class PredictionMetadata
java.lang.Object
java.lang.Record
com.cta4j.bus.prediction.model.PredictionMetadata
- Record Components:
timestamp- the date and time (UTC) this prediction was generateddynamicAction- theDynamicActionaffecting this predictionblockId- the scheduled block identifier for the vehicle associated with this predictiontripId- the scheduled trip identifier for the vehicle associated with this predictionoriginalTripNumber- the trip identifier for the vehicle associated with this predictioncountdownLabel- the countdown label associated with this prediction (e.g., "10", "DUE")zone- the zone name for the vehicle associated with this prediction, otherwise blankpassengerLoad- thePassengerLoadof the vehicle associated with this predictiongtfsSequence- the GTFS sequence number associated with this prediction, if applicablenextBus- the next bus identifier associated with this prediction, if applicablescheduledStartSeconds- the scheduled start time in seconds past midnight associated with this prediction, if applicablescheduledStartDate- the scheduled start date associated with this prediction, if applicableflagStop- theFlagStopinformation of the vehicle associated with this prediction
@NullMarked
public record PredictionMetadata(Instant timestamp, DynamicAction dynamicAction, String blockId, String tripId, String originalTripNumber, @Nullable String countdownLabel, String zone, PassengerLoad passengerLoad, @Nullable Integer gtfsSequence, @Nullable String nextBus, @Nullable Integer scheduledStartSeconds, @Nullable LocalDate scheduledStartDate, FlagStop flagStop)
extends Record
Represents metadata associated with a bus arrival prediction.
NOTE: gtfsSequence and nextBus are not well-documented by the CTA. As such, their
presence here is primarily for completeness and may not be populated or described correctly.
-
Constructor Summary
ConstructorsConstructorDescriptionPredictionMetadata(Instant timestamp, DynamicAction dynamicAction, String blockId, String tripId, String originalTripNumber, @Nullable String countdownLabel, String zone, PassengerLoad passengerLoad, @Nullable Integer gtfsSequence, @Nullable String nextBus, @Nullable Integer scheduledStartSeconds, @Nullable LocalDate scheduledStartDate, FlagStop flagStop) Constructs aPredictionMetadata. -
Method Summary
Modifier and TypeMethodDescriptionblockId()Returns the value of theblockIdrecord component.@Nullable StringReturns the value of thecountdownLabelrecord component.Returns the value of thedynamicActionrecord component.final booleanIndicates whether some other object is "equal to" this one.flagStop()Returns the value of theflagStoprecord component.@Nullable IntegerReturns the value of thegtfsSequencerecord component.final inthashCode()Returns a hash code value for this object.@Nullable StringnextBus()Returns the value of thenextBusrecord component.Returns the value of theoriginalTripNumberrecord component.Returns the value of thepassengerLoadrecord component.@Nullable LocalDateReturns the value of thescheduledStartDaterecord component.@Nullable IntegerReturns the value of thescheduledStartSecondsrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.tripId()Returns the value of thetripIdrecord component.zone()Returns the value of thezonerecord component.
-
Constructor Details
-
PredictionMetadata
public PredictionMetadata(Instant timestamp, DynamicAction dynamicAction, String blockId, String tripId, String originalTripNumber, @Nullable String countdownLabel, String zone, PassengerLoad passengerLoad, @Nullable Integer gtfsSequence, @Nullable String nextBus, @Nullable Integer scheduledStartSeconds, @Nullable LocalDate scheduledStartDate, FlagStop flagStop) Constructs aPredictionMetadata.- Parameters:
timestamp- the date and time (UTC) the prediction was generateddynamicAction- theDynamicActionaffecting the predictionblockId- the scheduled block identifier for the vehicle associated with the predictiontripId- the scheduled trip identifier for the vehicle associated with the predictionoriginalTripNumber- the trip identifier for the vehicle associated with the predictioncountdownLabel- the countdown label associated with this prediction (e.g., "10", "DUE")zone- the zone name for the vehicle associated with the prediction, otherwise blankpassengerLoad- thePassengerLoadof the vehicle associated with the predictiongtfsSequence- the GTFS sequence number associated with the prediction, if applicablenextBus- the next bus identifier associated with the prediction, if applicablescheduledStartSeconds- the scheduled start time in seconds past midnight associated with the prediction, if applicablescheduledStartDate- the scheduled start date associated with the prediction, if applicableflagStop- theFlagStopinformation of the vehicle associated with the prediction- Throws:
NullPointerException- iftimestamp,dynamicAction,blockId,tripId,originalTripNumber,zone,passengerLoad, orflagStopisnull
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
dynamicAction
Returns the value of thedynamicActionrecord component.- Returns:
- the value of the
dynamicActionrecord component
-
blockId
Returns the value of theblockIdrecord component.- Returns:
- the value of the
blockIdrecord component
-
tripId
Returns the value of thetripIdrecord component.- Returns:
- the value of the
tripIdrecord component
-
originalTripNumber
Returns the value of theoriginalTripNumberrecord component.- Returns:
- the value of the
originalTripNumberrecord component
-
countdownLabel
Returns the value of thecountdownLabelrecord component.- Returns:
- the value of the
countdownLabelrecord component
-
zone
Returns the value of thezonerecord component.- Returns:
- the value of the
zonerecord component
-
passengerLoad
Returns the value of thepassengerLoadrecord component.- Returns:
- the value of the
passengerLoadrecord component
-
gtfsSequence
Returns the value of thegtfsSequencerecord component.- Returns:
- the value of the
gtfsSequencerecord component
-
nextBus
Returns the value of thenextBusrecord component.- Returns:
- the value of the
nextBusrecord component
-
scheduledStartSeconds
Returns the value of thescheduledStartSecondsrecord component.- Returns:
- the value of the
scheduledStartSecondsrecord component
-
scheduledStartDate
Returns the value of thescheduledStartDaterecord component.- Returns:
- the value of the
scheduledStartDaterecord component
-
flagStop
Returns the value of theflagStoprecord component.- Returns:
- the value of the
flagStoprecord component
-