DeliveryTask.Builder

public static abstract class DeliveryTask.Builder extends Object

Builder class for DeliveryTask.

Public Method Summary

DeliveryTask
build()
Returns new DeliveryTask instance with the state set by the Builder.
final DeliveryTask.Builder
setParentId(String parentId)
This method is deprecated. Instead call setTrackingId(String)
abstract DeliveryTask.Builder
setPlannedWaypoint(Waypoint waypoint)
Sets the waypoint destination where the task will be completed.
abstract DeliveryTask.Builder
setProviderId(String providerId)
Sets the unique identifier for this provider.
abstract DeliveryTask.Builder
setTaskDurationSeconds(long durationSeconds)
Sets the additional time to perform an action at this location, measured in seconds.
abstract DeliveryTask.Builder
setTaskId(String taskId)
Sets the unique identifier for this task for this provider.
abstract DeliveryTask.Builder
setTaskName(String taskName)
Sets the unique name for this task, in the format "providers/{provider_id}/tasks/{task_id}".
abstract DeliveryTask.Builder
setTaskOutcome(int taskOutcome)
Sets the outcome of the closed task.
abstract DeliveryTask.Builder
setTaskOutcomeTimestamp(Long timestamp)
Sets the timestamp in milliseconds for when the task outcome was set.
abstract DeliveryTask.Builder
setTaskState(int taskState)
Sets the current execution state of the task.
abstract DeliveryTask.Builder
setTaskType(int taskType)
Sets the type of the task; for example, a break or shipment.
abstract DeliveryTask.Builder
setTrackingId(String trackingId)
Sets the unique identifier for the task (e.g.
abstract DeliveryTask.Builder
setVehicleId(String vehicleId)
Sets the identifier for the vehicle assigned to this task.

Inherited Method Summary

Public Methods

public DeliveryTask build ()

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

Throws
IllegalArgumentException if the task
  • is set with an invalid task name
  • is set with an invalid delivery task type
  • is of type DELIVERY_UNAVAILABLE or DELIVERY_SCHEDULED_STOP and sets a parent id
  • is of type DELIVERY_PICKUP or DELIVERY_DELIVERY and does not have a planned waypoint
  • is set with a task outcome but no outcome timestamp and vice versa.
NullPointerException if any non-nullable values are not set.

public final DeliveryTask.Builder setParentId (String parentId)

This method is deprecated.
Instead call setTrackingId(String)

Sets the unique identifier for the transaction (e.g. a trip id or tracking id) that this task is a part of.

public abstract DeliveryTask.Builder setPlannedWaypoint (Waypoint waypoint)

Sets the waypoint destination where the task will be completed.

public abstract DeliveryTask.Builder setProviderId (String providerId)

Sets the unique identifier for this provider.

public abstract DeliveryTask.Builder setTaskDurationSeconds (long durationSeconds)

Sets the additional time to perform an action at this location, measured in seconds.

public abstract DeliveryTask.Builder setTaskId (String taskId)

Sets the unique identifier for this task for this provider.

public abstract DeliveryTask.Builder setTaskName (String taskName)

Sets the unique name for this task, in the format "providers/{provider_id}/tasks/{task_id}". This is not a "tracking_id", which can have multiple tasks with the same identifier.

public abstract DeliveryTask.Builder setTaskOutcome (int taskOutcome)

Sets the outcome of the closed task.

public abstract DeliveryTask.Builder setTaskOutcomeTimestamp (Long timestamp)

Sets the timestamp in milliseconds for when the task outcome was set.

public abstract DeliveryTask.Builder setTaskState (int taskState)

Sets the current execution state of the task.

public abstract DeliveryTask.Builder setTaskType (int taskType)

Sets the type of the task; for example, a break or shipment.

public abstract DeliveryTask.Builder setTrackingId (String trackingId)

Sets the unique identifier for the task (e.g. a tracking id) that this task is part of.

public abstract DeliveryTask.Builder setVehicleId (String vehicleId)

Sets the identifier for the vehicle assigned to this task.