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 Details

    • findByStopIds

      List<Prediction> findByStopIds(StopsPredictionsQuery query)
      Retrieves predictions by stop IDs.
      Parameters:
      query - the query parameters for fetching predictions by stop IDs
      Returns:
      a List of Predictions corresponding to the provided stop IDs, or an empty List if no predictions are found
      Throws:
      NullPointerException - if query is null
    • findByVehicleIds

      List<Prediction> findByVehicleIds(VehiclesPredictionsQuery query)
      Retrieves predictions by vehicle IDs.
      Parameters:
      query - the query parameters for fetching predictions by vehicle IDs
      Returns:
      a List of Predictions corresponding to the provided vehicle IDs, or an empty List if no predictions are found
      Throws:
      NullPointerException - if query is null
    • findByRouteIdAndStopId

      default List<Prediction> findByRouteIdAndStopId(String routeId, String stopId)
      Retrieves predictions by route ID and stop ID.
      Parameters:
      routeId - the route ID
      stopId - the stop ID
      Returns:
      a List of Predictions corresponding to the provided route ID and stop ID, or an empty List if no predictions are found
      Throws:
      NullPointerException - if routeId or stopId is null
    • findByVehicleId

      default List<Prediction> findByVehicleId(String vehicleId)
      Retrieves predictions by vehicle ID.
      Parameters:
      vehicleId - the vehicle ID
      Returns:
      a List of Predictions corresponding to the provided vehicle ID, or an empty List if no predictions are found
      Throws:
      NullPointerException - if vehicleId is null