Class ShipmentRoute.TravelStep.Builder

  • All Implemented Interfaces:
    ShipmentRoute.TravelStepOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    ShipmentRoute.TravelStep

    public static final class ShipmentRoute.TravelStep.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
    implements ShipmentRoute.TravelStepOrBuilder
     Deprecated: Use
     [ShipmentRoute.Transition][google.cloud.optimization.v1.ShipmentRoute.Transition]
     instead. Travel between each visit along the route: from the vehicle's
     `start_location` to the first visit's `arrival_location`, then from the
     first visit's `departure_location` to the second visit's
     `arrival_location`, and so on until the vehicle's `end_location`. This
     accounts only for the actual travel between visits, not counting the
     waiting time, the time spent performing a visit, nor the distance covered
     during a visit.
    
     Invariant: `travel_steps_size() == visits_size() + 1`.
    
     If the vehicle does not have a start_ and/or end_location, the
     corresponding travel metrics are 0 and/or empty.
     
    Protobuf type google.cloud.optimization.v1.ShipmentRoute.TravelStep
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
      • getDefaultInstanceForType

        public ShipmentRoute.TravelStep getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public ShipmentRoute.TravelStep build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public ShipmentRoute.TravelStep buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • setRepeatedField

        public ShipmentRoute.TravelStep.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                                 int index,
                                                                 Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
      • addRepeatedField

        public ShipmentRoute.TravelStep.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                                 Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
      • mergeFrom

        public ShipmentRoute.TravelStep.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                   throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ShipmentRoute.TravelStep.Builder>
        Throws:
        IOException
      • hasDuration

        public boolean hasDuration()
         Duration of the travel step.
         
        .google.protobuf.Duration duration = 1;
        Specified by:
        hasDuration in interface ShipmentRoute.TravelStepOrBuilder
        Returns:
        Whether the duration field is set.
      • getDuration

        public com.google.protobuf.Duration getDuration()
         Duration of the travel step.
         
        .google.protobuf.Duration duration = 1;
        Specified by:
        getDuration in interface ShipmentRoute.TravelStepOrBuilder
        Returns:
        The duration.
      • setDuration

        public ShipmentRoute.TravelStep.Builder setDuration​(com.google.protobuf.Duration value)
         Duration of the travel step.
         
        .google.protobuf.Duration duration = 1;
      • setDuration

        public ShipmentRoute.TravelStep.Builder setDuration​(com.google.protobuf.Duration.Builder builderForValue)
         Duration of the travel step.
         
        .google.protobuf.Duration duration = 1;
      • mergeDuration

        public ShipmentRoute.TravelStep.Builder mergeDuration​(com.google.protobuf.Duration value)
         Duration of the travel step.
         
        .google.protobuf.Duration duration = 1;
      • getDurationBuilder

        public com.google.protobuf.Duration.Builder getDurationBuilder()
         Duration of the travel step.
         
        .google.protobuf.Duration duration = 1;
      • setDistanceMeters

        public ShipmentRoute.TravelStep.Builder setDistanceMeters​(double value)
         Distance traveled during the step.
         
        double distance_meters = 2;
        Parameters:
        value - The distanceMeters to set.
        Returns:
        This builder for chaining.
      • clearDistanceMeters

        public ShipmentRoute.TravelStep.Builder clearDistanceMeters()
         Distance traveled during the step.
         
        double distance_meters = 2;
        Returns:
        This builder for chaining.
      • getTrafficInfoUnavailable

        public boolean getTrafficInfoUnavailable()
         When traffic is requested via
         [OptimizeToursRequest.consider_road_traffic][google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
         and the traffic info couldn't be retrieved for a TravelStep, this boolean
         is set to true. This may be temporary (rare hiccup in the realtime
         traffic servers) or permanent (no data for this location).
         
        bool traffic_info_unavailable = 3;
        Specified by:
        getTrafficInfoUnavailable in interface ShipmentRoute.TravelStepOrBuilder
        Returns:
        The trafficInfoUnavailable.
      • setTrafficInfoUnavailable

        public ShipmentRoute.TravelStep.Builder setTrafficInfoUnavailable​(boolean value)
         When traffic is requested via
         [OptimizeToursRequest.consider_road_traffic][google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
         and the traffic info couldn't be retrieved for a TravelStep, this boolean
         is set to true. This may be temporary (rare hiccup in the realtime
         traffic servers) or permanent (no data for this location).
         
        bool traffic_info_unavailable = 3;
        Parameters:
        value - The trafficInfoUnavailable to set.
        Returns:
        This builder for chaining.
      • clearTrafficInfoUnavailable

        public ShipmentRoute.TravelStep.Builder clearTrafficInfoUnavailable()
         When traffic is requested via
         [OptimizeToursRequest.consider_road_traffic][google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
         and the traffic info couldn't be retrieved for a TravelStep, this boolean
         is set to true. This may be temporary (rare hiccup in the realtime
         traffic servers) or permanent (no data for this location).
         
        bool traffic_info_unavailable = 3;
        Returns:
        This builder for chaining.
      • hasRoutePolyline

        public boolean hasRoutePolyline()
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
        Specified by:
        hasRoutePolyline in interface ShipmentRoute.TravelStepOrBuilder
        Returns:
        Whether the routePolyline field is set.
      • getRoutePolyline

        public ShipmentRoute.EncodedPolyline getRoutePolyline()
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
        Specified by:
        getRoutePolyline in interface ShipmentRoute.TravelStepOrBuilder
        Returns:
        The routePolyline.
      • setRoutePolyline

        public ShipmentRoute.TravelStep.Builder setRoutePolyline​(ShipmentRoute.EncodedPolyline value)
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
      • setRoutePolyline

        public ShipmentRoute.TravelStep.Builder setRoutePolyline​(ShipmentRoute.EncodedPolyline.Builder builderForValue)
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
      • mergeRoutePolyline

        public ShipmentRoute.TravelStep.Builder mergeRoutePolyline​(ShipmentRoute.EncodedPolyline value)
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
      • clearRoutePolyline

        public ShipmentRoute.TravelStep.Builder clearRoutePolyline()
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
      • getRoutePolylineBuilder

        public ShipmentRoute.EncodedPolyline.Builder getRoutePolylineBuilder()
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
      • getRoutePolylineOrBuilder

        public ShipmentRoute.EncodedPolylineOrBuilder getRoutePolylineOrBuilder()
         The encoded polyline representation of the route followed during the
         step.
        
         This field is only populated if
         [OptimizeToursRequest.populate_travel_step_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines]
         is set to true.
         
        .google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;
        Specified by:
        getRoutePolylineOrBuilder in interface ShipmentRoute.TravelStepOrBuilder
      • setUnknownFields

        public final ShipmentRoute.TravelStep.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>
      • mergeUnknownFields

        public final ShipmentRoute.TravelStep.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>