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

public final class Trip
extends java.lang.Object
Entity for a single trip.
Author:
Stefan Kalscheuer
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    Trip​(Stop stop, java.lang.Integer visitID, java.lang.String lineID, java.lang.String lineName, java.lang.Integer directionID, java.lang.String destinationName, java.lang.String destinationText, java.lang.String vehicleID, java.lang.String tripID, java.lang.Long estimatedTime)
    Construct Trip object from Stop model and set of additional data.
    Trip​(java.lang.String stopID, java.lang.String stopName, java.lang.String stopIndicator, java.lang.Integer stopState, java.lang.Double stopLatitude, java.lang.Double stopLongitude, java.lang.Integer visitID, java.lang.String lineID, java.lang.String lineName, java.lang.Integer directionID, java.lang.String destinationName, java.lang.String destinationText, java.lang.String vehicleID, java.lang.String tripID, java.lang.Long estimatedTime)
    Construct Trip object from complete set of data.
    Trip​(java.util.List<java.io.Serializable> raw)
    Construct Trip object from raw list of attributes parsed from JSON.
    Trip​(java.util.List<java.io.Serializable> raw, java.lang.String version)
    Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getDestinationName()
    The full length destination name of the trip the vehicle is on.
    java.lang.String getDestinationText()
    The abbreviated destination name of the trip the vehicle is on.
    java.lang.Integer getDirectionID()
    This identifies the direction of the trip that the vehicle is on.
    java.lang.Long getEstimatedTime()
    This is the predicted time of arrival for the vehicle at a specific stop.
    java.lang.String getId()  
    java.lang.String getLineID()
    The identifier of a route.
    java.lang.String getLineName()
    This is the route number that is displayed on the front of the bus and on any publicity advertising the route.
    Stop getStop()
    The starting stop.
    java.lang.String getVehicleID()
    The unique identifier of the vehicle.
    java.lang.Integer getVisitID()
    Visit identifier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Trip

      public Trip​(java.lang.String stopID, java.lang.String stopName, java.lang.String stopIndicator, java.lang.Integer stopState, java.lang.Double stopLatitude, java.lang.Double stopLongitude, java.lang.Integer visitID, java.lang.String lineID, java.lang.String lineName, java.lang.Integer directionID, java.lang.String destinationName, java.lang.String destinationText, java.lang.String vehicleID, java.lang.String tripID, java.lang.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, java.lang.Integer visitID, java.lang.String lineID, java.lang.String lineName, java.lang.Integer directionID, java.lang.String destinationName, java.lang.String destinationText, java.lang.String vehicleID, java.lang.String tripID, java.lang.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​(java.util.List<java.io.Serializable> raw) throws java.io.IOException
      Construct Trip object from raw list of attributes parsed from JSON.
      Parameters:
      raw - List of attributes from JSON line
      Throws:
      java.io.IOException - Thrown on invalid line format.
    • Trip

      public Trip​(java.util.List<java.io.Serializable> raw, java.lang.String version) throws java.io.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:
      java.io.IOException - Thrown on invalid line format.
  • Method Details

    • getStop

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

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

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

      public java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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.