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 generated
dynamicAction - the DynamicAction affecting this prediction
blockId - the scheduled block identifier for the vehicle associated with this prediction
tripId - the scheduled trip identifier for the vehicle associated with this prediction
originalTripNumber - the trip identifier for the vehicle associated with this prediction
countdownLabel - the countdown label associated with this prediction (e.g., "10", "DUE")
zone - the zone name for the vehicle associated with this prediction, otherwise blank
passengerLoad - the PassengerLoad of the vehicle associated with this prediction
gtfsSequence - the GTFS sequence number associated with this prediction, if applicable
nextBus - the next bus identifier associated with this prediction, if applicable
scheduledStartSeconds - the scheduled start time in seconds past midnight associated with this prediction, if applicable
scheduledStartDate - the scheduled start date associated with this prediction, if applicable
flagStop - the FlagStop information 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 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 a PredictionMetadata.
      Parameters:
      timestamp - the date and time (UTC) the prediction was generated
      dynamicAction - the DynamicAction affecting the prediction
      blockId - the scheduled block identifier for the vehicle associated with the prediction
      tripId - the scheduled trip identifier for the vehicle associated with the prediction
      originalTripNumber - the trip identifier for the vehicle associated with the prediction
      countdownLabel - the countdown label associated with this prediction (e.g., "10", "DUE")
      zone - the zone name for the vehicle associated with the prediction, otherwise blank
      passengerLoad - the PassengerLoad of the vehicle associated with the prediction
      gtfsSequence - the GTFS sequence number associated with the prediction, if applicable
      nextBus - the next bus identifier associated with the prediction, if applicable
      scheduledStartSeconds - the scheduled start time in seconds past midnight associated with the prediction, if applicable
      scheduledStartDate - the scheduled start date associated with the prediction, if applicable
      flagStop - the FlagStop information of the vehicle associated with the prediction
      Throws:
      NullPointerException - if timestamp, dynamicAction, blockId, tripId, originalTripNumber, zone, passengerLoad, or flagStop is null
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • dynamicAction

      public DynamicAction dynamicAction()
      Returns the value of the dynamicAction record component.
      Returns:
      the value of the dynamicAction record component
    • blockId

      public String blockId()
      Returns the value of the blockId record component.
      Returns:
      the value of the blockId record component
    • tripId

      public String tripId()
      Returns the value of the tripId record component.
      Returns:
      the value of the tripId record component
    • originalTripNumber

      public String originalTripNumber()
      Returns the value of the originalTripNumber record component.
      Returns:
      the value of the originalTripNumber record component
    • countdownLabel

      public @Nullable String countdownLabel()
      Returns the value of the countdownLabel record component.
      Returns:
      the value of the countdownLabel record component
    • zone

      public String zone()
      Returns the value of the zone record component.
      Returns:
      the value of the zone record component
    • passengerLoad

      public PassengerLoad passengerLoad()
      Returns the value of the passengerLoad record component.
      Returns:
      the value of the passengerLoad record component
    • gtfsSequence

      public @Nullable Integer gtfsSequence()
      Returns the value of the gtfsSequence record component.
      Returns:
      the value of the gtfsSequence record component
    • nextBus

      public @Nullable String nextBus()
      Returns the value of the nextBus record component.
      Returns:
      the value of the nextBus record component
    • scheduledStartSeconds

      public @Nullable Integer scheduledStartSeconds()
      Returns the value of the scheduledStartSeconds record component.
      Returns:
      the value of the scheduledStartSeconds record component
    • scheduledStartDate

      public @Nullable LocalDate scheduledStartDate()
      Returns the value of the scheduledStartDate record component.
      Returns:
      the value of the scheduledStartDate record component
    • flagStop

      public FlagStop flagStop()
      Returns the value of the flagStop record component.
      Returns:
      the value of the flagStop record component