Package com.cta4j.bus.stop
Interface StopsApi
@NullMarked
public interface StopsApi
Provides access to stop-related endpoints of the CTA BusTime API.
This API allows retrieval of stops by route ID and direction, as well as by stop IDs.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a stop by its ID.findByIds(Collection<String> stopIds) Retrieves stops by their IDs.findByRouteIdAndDirection(String routeId, String direction) Retrieves stops by route ID and direction.
-
Method Details
-
findByRouteIdAndDirection
Retrieves stops by route ID and direction.- Parameters:
routeId- the route IDdirection- the direction (e.g., "Northbound", "Southbound")- Returns:
- a
ListofStops corresponding to the provided route ID and direction, or an emptyListif no stops are found - Throws:
NullPointerException- ifrouteIdordirectionisnull
-
findByIds
Retrieves stops by their IDs.- Parameters:
stopIds- aCollectionof stop IDs- Returns:
- a
ListofStops corresponding to the provided stop IDs, or an emptyListif no stops are found - Throws:
NullPointerException- ifstopIdsisnullor containsnullelements
-
findById
Retrieves a stop by its ID.- Parameters:
stopId- the stop ID- Returns:
- an
Optionalcontaining theStopif found, or an emptyOptionalif no stop exists with the given ID - Throws:
NullPointerException- ifstopIdisnullCta4jException- if multiple stops are found for the given ID
-