Record Class VehicleMetadata

java.lang.Object
java.lang.Record
com.cta4j.bus.vehicle.model.VehicleMetadata
Record Components:
dataFeed - the data feed from which this vehicle information was obtained, if applicable
lastUpdated - the date and time (UTC) this vehicle information was last updated, if applicable
patternId - the pattern identifier for the trip this vehicle is servicing
distanceToPatternPoint - the number of feet this vehicle has traveled into the pattern currently being serviced
stopStatus - the stop status of this vehicle, if applicable
timepointId - the timepoint identifier associated with this vehicle, if applicable
stopId - the stop identifier associated with this vehicle, if applicable
sequence - the sequence number associated with this vehicle, if applicable
gtfsSequence - the GTFS sequence number associated with this vehicle, if applicable
serverTimestamp - the date and time (UTC) this vehicle information was received by the server, if applicable
speed - the current speed of this vehicle in miles per hour, if applicable
block - the block number for this vehicle, if applicable
blockId - the scheduled block identifier for this vehicle
tripId - the scheduled trip identifier for this vehicle
originalTripNumber - the trip identifier for this vehicle
zone - the zone name for this vehicle, otherwise blank
mode - the TransitMode of this vehicle
passengerLoad - the PassengerLoad of this vehicle
scheduledStartSeconds - the scheduled start time in seconds past midnight associated with this vehicle, if applicable
scheduledStartDate - the scheduled start date associated with this vehicle, if applicable

@NullMarked public record VehicleMetadata(@Nullable String dataFeed, @Nullable Instant lastUpdated, String patternId, int distanceToPatternPoint, @Nullable Integer stopStatus, @Nullable Integer timepointId, @Nullable String stopId, @Nullable Integer sequence, @Nullable Integer gtfsSequence, @Nullable Instant serverTimestamp, @Nullable Integer speed, @Nullable Integer block, String blockId, String tripId, String originalTripNumber, String zone, TransitMode mode, PassengerLoad passengerLoad, @Nullable Integer scheduledStartSeconds, @Nullable LocalDate scheduledStartDate) extends Record
Represents metadata associated with a vehicle.

NOTE: dataFeed, stopStatus, timepointId, stopId, sequence, gtfsSequence, serverTimestamp, speed, and block 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

    • VehicleMetadata

      public VehicleMetadata(@Nullable String dataFeed, @Nullable Instant lastUpdated, String patternId, int distanceToPatternPoint, @Nullable Integer stopStatus, @Nullable Integer timepointId, @Nullable String stopId, @Nullable Integer sequence, @Nullable Integer gtfsSequence, @Nullable Instant serverTimestamp, @Nullable Integer speed, @Nullable Integer block, String blockId, String tripId, String originalTripNumber, String zone, TransitMode mode, PassengerLoad passengerLoad, @Nullable Integer scheduledStartSeconds, @Nullable LocalDate scheduledStartDate)
      Constructs a VehicleMetadata.
      Parameters:
      dataFeed - the data feed from which the vehicle information was obtained, if applicable
      lastUpdated - the date and time (UTC) the vehicle information was last updated, if applicable
      patternId - the pattern identifier for the trip the vehicle is servicing
      distanceToPatternPoint - the number of feet the vehicle has traveled into the pattern currently being serviced
      stopStatus - the stop status of the vehicle, if applicable
      timepointId - the timepoint identifier associated with the vehicle, if applicable
      stopId - the stop identifier associated with the vehicle, if applicable
      sequence - the sequence number associated with the vehicle, if applicable
      gtfsSequence - the GTFS sequence number associated with the vehicle, if applicable
      serverTimestamp - the date and time (UTC) the vehicle information was received by the server, if applicable
      speed - the current speed of the vehicle in miles per hour, if applicable
      block - the block number for the vehicle, if applicable
      blockId - the scheduled block identifier for the vehicle
      tripId - the scheduled trip identifier for the vehicle
      originalTripNumber - the trip identifier for the vehicle
      zone - the zone name for the vehicle, otherwise blank
      mode - the TransitMode of the vehicle
      passengerLoad - the PassengerLoad of the vehicle
      scheduledStartSeconds - the scheduled start time in seconds past midnight associated with the vehicle, if applicable
      scheduledStartDate - the scheduled start date associated with the vehicle, if applicable
      Throws:
      NullPointerException - if patternId, blockId, tripId, originalTripNumber, zone, mode, or passengerLoad 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • dataFeed

      public @Nullable String dataFeed()
      Returns the value of the dataFeed record component.
      Returns:
      the value of the dataFeed record component
    • lastUpdated

      public @Nullable Instant lastUpdated()
      Returns the value of the lastUpdated record component.
      Returns:
      the value of the lastUpdated record component
    • patternId

      public String patternId()
      Returns the value of the patternId record component.
      Returns:
      the value of the patternId record component
    • distanceToPatternPoint

      public int distanceToPatternPoint()
      Returns the value of the distanceToPatternPoint record component.
      Returns:
      the value of the distanceToPatternPoint record component
    • stopStatus

      public @Nullable Integer stopStatus()
      Returns the value of the stopStatus record component.
      Returns:
      the value of the stopStatus record component
    • timepointId

      public @Nullable Integer timepointId()
      Returns the value of the timepointId record component.
      Returns:
      the value of the timepointId record component
    • stopId

      public @Nullable String stopId()
      Returns the value of the stopId record component.
      Returns:
      the value of the stopId record component
    • sequence

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

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

      public @Nullable Instant serverTimestamp()
      Returns the value of the serverTimestamp record component.
      Returns:
      the value of the serverTimestamp record component
    • speed

      public @Nullable Integer speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component
    • block

      public @Nullable Integer block()
      Returns the value of the block record component.
      Returns:
      the value of the block 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
    • zone

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

      public TransitMode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • passengerLoad

      public PassengerLoad passengerLoad()
      Returns the value of the passengerLoad record component.
      Returns:
      the value of the passengerLoad 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