Page Summary
-
DriverContext.Builderis used to create aDriverContextinstance, which holds essential information for the Driver SDK. -
It provides methods to set necessary components like application context, authentication token factory, and navigation dependencies.
-
The builder also allows setting identifiers for the provider and vehicle, along with an optional listener for status updates.
-
Once all required values are set, calling
build()creates theDriverContextobject. -
If any essential value is missing, a
NullPointerExceptionwill be thrown during the build process.
Builder for DriverContext.
Public Method Summary
| DriverContext |
build()
Returns new DriverContext instance with the state set by the Builder.
|
| abstract DriverContext.Builder | |
| abstract DriverContext.Builder |
setAuthTokenFactory(AuthTokenContext.AuthTokenFactory
authTokenFactory)
Sets the factory for generating JWT for the given call context.
|
| abstract DriverContext.Builder |
setDriverStatusListener(DriverContext.DriverStatusListener
driverStatusListener)
Sets the optional listener for status updates.
|
| abstract DriverContext.Builder |
setNavigator(Navigator navigator)
Sets the initialized Navigator singleton.
|
| abstract DriverContext.Builder | |
| abstract DriverContext.Builder |
setRoadSnappedLocationProvider(RoadSnappedLocationProvider provider)
Sets the RoadSnappedLocationProvider from the NavigationApi.
|
| abstract DriverContext.Builder |
Inherited Method Summary
Public Methods
public DriverContext build ()
Returns new DriverContext instance with the state set by the Builder.
Throws
| NullPointerException | if any non-nullable values are not set. |
|---|
public abstract DriverContext.Builder setApplication (Application application)
Sets the application context.
public abstract DriverContext.Builder setAuthTokenFactory (AuthTokenContext.AuthTokenFactory authTokenFactory)
Sets the factory for generating JWT for the given call context.
public abstract DriverContext.Builder setDriverStatusListener (DriverContext.DriverStatusListener driverStatusListener)
Sets the optional listener for status updates.
public abstract DriverContext.Builder setNavigator (Navigator navigator)
Sets the initialized Navigator singleton.
public abstract DriverContext.Builder setProviderId (String providerId)
Sets the unique identifier for this provider.
public abstract DriverContext.Builder setRoadSnappedLocationProvider (RoadSnappedLocationProvider provider)
Sets the RoadSnappedLocationProvider from the NavigationApi.
public abstract DriverContext.Builder setVehicleId (String vehicleId)
Sets the unique identifier for this vehicle for this provider.