java.lang.Object
de.stklcode.pubtrans.ura.model.Trip
All Implemented Interfaces:
Serializable

public final class Trip extends Object
Entity for a single trip.
Author:
Stefan Kalscheuer
See Also:
  • Constructor Details

    • Trip

      public Trip(String stopID, String stopName, String stopIndicator, Integer stopState, Double stopLatitude, Double stopLongitude, Integer visitID, String lineID, String lineName, Integer directionID, String destinationName, String destinationText, String vehicleID, String tripID, Long estimatedTime)
      Construct Trip object from complete set of data.
      Parameters:
      stopID - Stop ID.
      stopName - Stop name.
      stopIndicator - Stop Indicator.
      stopState - Stop state.
      stopLatitude - Stop geolocation latitude.
      stopLongitude - Stop geolocation latitude.
      visitID - Visit ID.
      lineID - Line ID.
      lineName - Line name.
      directionID - Direction ID.
      destinationName - Destination name.
      destinationText - Destination text.
      vehicleID - Vehicle ID.
      tripID - Trip ID.
      estimatedTime - Estimated time.
    • Trip

      public Trip(Stop stop, Integer visitID, String lineID, String lineName, Integer directionID, String destinationName, String destinationText, String vehicleID, String tripID, Long estimatedTime)
      Construct Trip object from Stop model and set of additional data.
      Parameters:
      stop - Stop model
      visitID - Visit ID
      lineID - Line ID
      lineName - Line name
      directionID - Direction ID
      destinationName - Destination name
      destinationText - Destination text
      vehicleID - Vehicle ID
      tripID - Trip ID
      estimatedTime - Estimated time
    • Trip

      public Trip(List<Serializable> raw) throws IOException
      Construct Trip object from raw list of attributes parsed from JSON.
      Parameters:
      raw - List of attributes from JSON line
      Throws:
      IOException - Thrown on invalid line format.
    • Trip

      public Trip(List<Serializable> raw, String version) throws IOException
      Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version.
      Parameters:
      raw - List of attributes from JSON line
      version - API version
      Throws:
      IOException - Thrown on invalid line format.
  • Method Details

    • getStop

      public Stop getStop()
      The starting stop.
      Returns:
      The (starting) stop.
    • getId

      public String getId()
      Returns:
      The trip ID.
    • getVisitID

      public Integer getVisitID()
      Visit identifier.
      Returns:
      The visit ID.
    • getLineID

      public String getLineID()
      The identifier of a route. This is an internal identifier and is not equal to the route number displayed on the front of the bus. It should not be displayed to the public.
      Returns:
      The line ID.
    • getLineName

      public String getLineName()
      This is the route number that is displayed on the front of the bus and on any publicity advertising the route.
      Returns:
      The line name.
    • getDirectionID

      public Integer getDirectionID()
      This identifies the direction of the trip that the vehicle is on. It indicates whether the vehicle is on an outbound or inbound trip.
      Returns:
      The direction ID.
    • getDestinationName

      public String getDestinationName()
      The full length destination name of the trip the vehicle is on. The destination name is based on the route and end point of the trip.
      Returns:
      The destination name.
    • getDestinationText

      public String getDestinationText()
      The abbreviated destination name of the trip the vehicle is on. The destination text is based on the route and end point of the trip.
      Returns:
      The destination text.
    • getEstimatedTime

      public Long getEstimatedTime()
      This is the predicted time of arrival for the vehicle at a specific stop. It is an absolute time in UTC as per Unix epoch (in milliseconds).
      Returns:
      The estimated departure time.
    • getVehicleID

      public String getVehicleID()
      The unique identifier of the vehicle. This is an internal identifier and should not be displayed to the public.
      Returns:
      The vehicle ID or null if not present.