Class BusClientImpl

java.lang.Object
com.cta4j.bus.client.internal.BusClientImpl
All Implemented Interfaces:
BusClient

@Internal public final class BusClientImpl extends Object implements BusClient
  • Method Details

    • getRoutes

      public List<Route> getRoutes()
      Description copied from interface: BusClient
      Retrieves a List of all bus routes.
      Specified by:
      getRoutes in interface BusClient
      Returns:
      a List of all bus routes
    • getDirections

      public List<String> getDirections(String routeId)
      Description copied from interface: BusClient
      Retrieves a List of directions for a specific bus route.
      Specified by:
      getDirections in interface BusClient
      Parameters:
      routeId - the ID of the bus route
      Returns:
      a List of directions for the specified bus route
    • getStops

      public List<Stop> getStops(String routeId, String direction)
      Description copied from interface: BusClient
      Retrieves a List of stops for a specific bus route and direction.
      Specified by:
      getStops in interface BusClient
      Parameters:
      routeId - the ID of the bus route
      direction - the direction of the bus route
      Returns:
      a List of stops for the specified bus route and direction
    • getStopArrivals

      public List<StopArrival> getStopArrivals(String routeId, String stopId)
      Description copied from interface: BusClient
      Retrieves a List of upcoming arrivals for a specific bus route and stop.
      Specified by:
      getStopArrivals in interface BusClient
      Parameters:
      routeId - the ID of the bus route
      stopId - the ID of the bus stop
      Returns:
      a List of upcoming arrivals for the specified bus route and stop
    • getDetours

      public List<Detour> getDetours(String routeId, String direction)
      Description copied from interface: BusClient
      Retrieves a List of detours for a specific bus route and direction.
      Specified by:
      getDetours in interface BusClient
      Parameters:
      routeId - the ID of the bus route
      direction - the direction of the bus route
      Returns:
      a List of detours for the specified bus route and direction
    • getBus

      public Optional<Bus> getBus(String id)
      Description copied from interface: BusClient
      Retrieves information about a specific bus by its ID.
      Specified by:
      getBus in interface BusClient
      Parameters:
      id - the ID of the bus
      Returns:
      an Optional containing the bus information if found, or an empty Optional if not found