Package de.stklcode.pubtrans.ura.model
Class Trip
- 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description 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.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.Trip(List raw)Construct Trip object from raw list of attributes parsed from JSON.Trip(List raw, String version)Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDestinationName()StringgetDestinationText()IntegergetDirectionID()LonggetEstimatedTime()StringgetId()StringgetLineID()StringgetLineName()StopgetStop()StringgetVehicleID()IntegergetVisitID()
-
-
-
Constructor Detail
-
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
public Trip(List 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 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 lineversion- API version- Throws:
IOException- Thrown on invalid line format.
-
-
Method Detail
-
getStop
public Stop getStop()
- Returns:
- The (starting) stop.
-
getId
public String getId()
- Returns:
- The trip ID.
-
getVisitID
public Integer getVisitID()
- Returns:
- The visit ID.
-
getLineID
public String getLineID()
- Returns:
- The line ID.
-
getLineName
public String getLineName()
- Returns:
- The line name.
-
getDirectionID
public Integer getDirectionID()
- Returns:
- The direction ID.
-
getDestinationName
public String getDestinationName()
- Returns:
- The destination name.
-
getDestinationText
public String getDestinationText()
- Returns:
- The destination text.
-
getEstimatedTime
public Long getEstimatedTime()
- Returns:
- The estimated departure time.
-
getVehicleID
public String getVehicleID()
- Returns:
- The vehicle ID or
nullif not present.
-
-