DeliveryVehicle.Builder

  • DeliveryVehicle.Builder is used to create instances of DeliveryVehicle with specific attributes like provider ID, vehicle ID, name, and stops.

  • The build() method creates a new DeliveryVehicle instance based on the information provided to the builder.

  • You can set the unique identifier for the provider and the vehicle, as well as the vehicle's name using the setProviderId(), setVehicleId(), and setVehicleName() methods, respectively.

  • The setVehicleStops() method, while used for reporting stops assigned by FleetEngine, is ignored for generating requests and should be managed using the VehicleReporter.

public static abstract class DeliveryVehicle.Builder extends Object

Builder class for DeliveryVehicle.

Public Method Summary

DeliveryVehicle
build()
Returns new DeliveryVehicle instance with the state set by the Builder.
abstract DeliveryVehicle.Builder
setProviderId(String providerId)
Returns the unique identifier for this provider.
abstract DeliveryVehicle.Builder
setVehicleId(String vehicleId)
Sets the unique identifier for this vehicle for this provider.
abstract DeliveryVehicle.Builder
setVehicleName(String vehicleName)
Sets the unique name for this vehicle, in the format "providers/{provider_id}/delivery_vehicles/{vehicle_id}".
abstract DeliveryVehicle.Builder
setVehicleStops(List<VehicleStop> value)
Sets the stops currently assigned to this vehicle as reported by FleetEngine.

Inherited Method Summary

Public Methods

public DeliveryVehicle build ()

Returns new DeliveryVehicle instance with the state set by the Builder.

Throws
IllegalArgumentException if set with an invalid vehicle name.

public abstract DeliveryVehicle.Builder setProviderId (String providerId)

Returns the unique identifier for this provider.

public abstract DeliveryVehicle.Builder setVehicleId (String vehicleId)

Sets the unique identifier for this vehicle for this provider.

public abstract DeliveryVehicle.Builder setVehicleName (String vehicleName)

Sets the unique name for this vehicle, in the format "providers/{provider_id}/delivery_vehicles/{vehicle_id}".

public abstract DeliveryVehicle.Builder setVehicleStops (List<VehicleStop> value)

Sets the stops currently assigned to this vehicle as reported by FleetEngine.

This field is ignored when used to generate requests, but will be returned in responses. DriverSdk users are expected to set vehicle stops using the VehicleReporter.