Package de.stklcode.pubtrans.ura.model
Class Trip
java.lang.Object
de.stklcode.pubtrans.ura.model.Trip
- All Implemented Interfaces:
Serializable
Entity for a single trip.
- Author:
- Stefan Kalscheuer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTrip(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.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.Construct Trip object from raw list of attributes parsed from JSON.Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version. -
Method Summary
-
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 modelvisitID- Visit IDlineID- Line IDlineName- Line namedirectionID- Direction IDdestinationName- Destination namedestinationText- Destination textvehicleID- Vehicle IDtripID- Trip IDestimatedTime- Estimated time
-
Trip
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
Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version.- Parameters:
raw- List of attributes from JSON lineversion- API version- Throws:
IOException- Thrown on invalid line format.
-
-
Method Details
-
getStop
- Returns:
- The (starting) stop.
-
getId
- Returns:
- The trip ID.
-
getVisitID
- Returns:
- The visit ID.
-
getLineID
- Returns:
- The line ID.
-
getLineName
- Returns:
- The line name.
-
getDirectionID
- Returns:
- The direction ID.
-
getDestinationName
- Returns:
- The destination name.
-
getDestinationText
- Returns:
- The destination text.
-
getEstimatedTime
- Returns:
- The estimated departure time.
-
getVehicleID
- Returns:
- The vehicle ID or
nullif not present.
-