Package com.cta4j.bus
Interface BusApi
@NullMarked
public interface BusApi
Primary entry point for interacting with the CTA Bus Tracker API.
This interface provides access to the current system time as well as grouped sub-APIs for vehicles, routes, directions, stops, patterns, predictions, locales, and detours.
Instances of BusApi are immutable and thread-safe once built.
Use builder(String) to construct a configured instance.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic BusApi.BuilderCreates a newBusApi.Builderfor constructing aBusApi.detours()Provides access to detour-related endpoints.Provides access to direction-related endpoints.locales()Provides access to locale and language-related endpoints.patterns()Provides access to route pattern–related endpoints.Provides access to prediction and arrival-related endpoints.routes()Provides access to route-related endpoints.stops()Provides access to stop-related endpoints.Returns the current system time reported by the Bus Tracker API.vehicles()Provides access to vehicle-related endpoints.
-
Method Details
-
systemTime
Instant systemTime()Returns the current system time reported by the Bus Tracker API.- Returns:
- the API system time as an
Instant
-
vehicles
VehiclesApi vehicles()Provides access to vehicle-related endpoints.- Returns:
- the
VehiclesApi
-
routes
RoutesApi routes()Provides access to route-related endpoints.- Returns:
- the
RoutesApi
-
directions
DirectionsApi directions()Provides access to direction-related endpoints.- Returns:
- the
DirectionsApi
-
stops
StopsApi stops()Provides access to stop-related endpoints.- Returns:
- the
StopsApi
-
patterns
PatternsApi patterns()Provides access to route pattern–related endpoints.- Returns:
- the
PatternsApi
-
predictions
PredictionsApi predictions()Provides access to prediction and arrival-related endpoints.- Returns:
- the
PredictionsApi
-
locales
LocalesApi locales()Provides access to locale and language-related endpoints.- Returns:
- the
LocalesApi
-
detours
DetoursApi detours()Provides access to detour-related endpoints.- Returns:
- the
DetoursApi
-
builder
Creates a newBusApi.Builderfor constructing aBusApi.- Parameters:
apiKey- the CTA Bus Tracker API key- Returns:
- a new
BusApi.Builder - Throws:
NullPointerException- ifapiKeyisnull
-