Package com.cta4j.bus.pattern
Interface PatternsApi
@NullMarked
public interface PatternsApi
Provides access to route pattern-related endpoints of the CTA BusTime API.
This API allows retrieval of route patterns by their IDs or by associated route IDs.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<RoutePattern> Retrieves a route pattern by its pattern ID.findByIds(Collection<String> patternIds) Retrieves route patterns by their pattern IDs.findByRouteId(String routeId) Retrieves all route patterns for the specified route ID.
-
Method Details
-
findByIds
Retrieves route patterns by their pattern IDs.- Parameters:
patternIds- aCollectionof route pattern IDs- Returns:
- a
ListofRoutePatterns corresponding to the provided IDs, or an emptyListif no patterns are found - Throws:
NullPointerException- ifpatternIdsisnullor containsnullelements
-
findById
Retrieves a route pattern by its pattern ID.- Parameters:
patternId- the route pattern ID- Returns:
- an
Optionalcontaining theRoutePatternif found, or an emptyOptionalif no pattern exists with the given ID - Throws:
NullPointerException- ifpatternIdisnull
-
findByRouteId
Retrieves all route patterns for the specified route ID.- Parameters:
routeId- the route ID- Returns:
- a
ListofRoutePatterns associated with the route ID, or an emptyListif no patterns exist for the route ID - Throws:
NullPointerException- ifrouteIdisnull
-