Package com.cta4j.bus.prediction
Interface PredictionsApi
@NullMarked
public interface PredictionsApi
Provides access to prediction-related endpoints of the CTA BusTime API.
This API allows retrieval of predictions by stop IDs or vehicle IDs.
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<Prediction> findByRouteIdAndStopId(String routeId, String stopId) Retrieves predictions by route ID and stop ID.Retrieves predictions by stop IDs.default List<Prediction> findByVehicleId(String vehicleId) Retrieves predictions by vehicle ID.Retrieves predictions by vehicle IDs.
-
Method Details
-
findByStopIds
Retrieves predictions by stop IDs.- Parameters:
query- the query parameters for fetching predictions by stop IDs- Returns:
- a
ListofPredictions corresponding to the provided stop IDs, or an emptyListif no predictions are found - Throws:
NullPointerException- ifqueryisnull
-
findByVehicleIds
Retrieves predictions by vehicle IDs.- Parameters:
query- the query parameters for fetching predictions by vehicle IDs- Returns:
- a
ListofPredictions corresponding to the provided vehicle IDs, or an emptyListif no predictions are found - Throws:
NullPointerException- ifqueryisnull
-
findByRouteIdAndStopId
Retrieves predictions by route ID and stop ID.- Parameters:
routeId- the route IDstopId- the stop ID- Returns:
- a
ListofPredictions corresponding to the provided route ID and stop ID, or an emptyListif no predictions are found - Throws:
NullPointerException- ifrouteIdorstopIdisnull
-
findByVehicleId
Retrieves predictions by vehicle ID.- Parameters:
vehicleId- the vehicle ID- Returns:
- a
ListofPredictions corresponding to the provided vehicle ID, or an emptyListif no predictions are found - Throws:
NullPointerException- ifvehicleIdisnull
-