• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/optimization/v1/fleet_routing.proto
18 
19 package com.google.cloud.optimization.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Response after solving a tour optimization problem containing the routes
26  * followed by each vehicle, the shipments which have been skipped and the
27  * overall cost of the solution.
28  * </pre>
29  *
30  * Protobuf type {@code google.cloud.optimization.v1.OptimizeToursResponse}
31  */
32 public final class OptimizeToursResponse extends com.google.protobuf.GeneratedMessageV3
33     implements
34     // @@protoc_insertion_point(message_implements:google.cloud.optimization.v1.OptimizeToursResponse)
35     OptimizeToursResponseOrBuilder {
36   private static final long serialVersionUID = 0L;
37   // Use OptimizeToursResponse.newBuilder() to construct.
OptimizeToursResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)38   private OptimizeToursResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
39     super(builder);
40   }
41 
OptimizeToursResponse()42   private OptimizeToursResponse() {
43     routes_ = java.util.Collections.emptyList();
44     requestLabel_ = "";
45     skippedShipments_ = java.util.Collections.emptyList();
46     validationErrors_ = java.util.Collections.emptyList();
47   }
48 
49   @java.lang.Override
50   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)51   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
52     return new OptimizeToursResponse();
53   }
54 
55   @java.lang.Override
getUnknownFields()56   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
57     return this.unknownFields;
58   }
59 
getDescriptor()60   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
61     return com.google.cloud.optimization.v1.FleetRoutingProto
62         .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_descriptor;
63   }
64 
65   @java.lang.Override
66   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()67       internalGetFieldAccessorTable() {
68     return com.google.cloud.optimization.v1.FleetRoutingProto
69         .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_fieldAccessorTable
70         .ensureFieldAccessorsInitialized(
71             com.google.cloud.optimization.v1.OptimizeToursResponse.class,
72             com.google.cloud.optimization.v1.OptimizeToursResponse.Builder.class);
73   }
74 
75   public interface MetricsOrBuilder
76       extends
77       // @@protoc_insertion_point(interface_extends:google.cloud.optimization.v1.OptimizeToursResponse.Metrics)
78       com.google.protobuf.MessageOrBuilder {
79 
80     /**
81      *
82      *
83      * <pre>
84      * Aggregated over the routes. Each metric is the sum (or max, for loads)
85      * over all
86      * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
87      * fields of the same name.
88      * </pre>
89      *
90      * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
91      *
92      * @return Whether the aggregatedRouteMetrics field is set.
93      */
hasAggregatedRouteMetrics()94     boolean hasAggregatedRouteMetrics();
95     /**
96      *
97      *
98      * <pre>
99      * Aggregated over the routes. Each metric is the sum (or max, for loads)
100      * over all
101      * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
102      * fields of the same name.
103      * </pre>
104      *
105      * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
106      *
107      * @return The aggregatedRouteMetrics.
108      */
getAggregatedRouteMetrics()109     com.google.cloud.optimization.v1.AggregatedMetrics getAggregatedRouteMetrics();
110     /**
111      *
112      *
113      * <pre>
114      * Aggregated over the routes. Each metric is the sum (or max, for loads)
115      * over all
116      * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
117      * fields of the same name.
118      * </pre>
119      *
120      * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
121      */
122     com.google.cloud.optimization.v1.AggregatedMetricsOrBuilder
getAggregatedRouteMetricsOrBuilder()123         getAggregatedRouteMetricsOrBuilder();
124 
125     /**
126      *
127      *
128      * <pre>
129      * Number of mandatory shipments skipped.
130      * </pre>
131      *
132      * <code>int32 skipped_mandatory_shipment_count = 2;</code>
133      *
134      * @return The skippedMandatoryShipmentCount.
135      */
getSkippedMandatoryShipmentCount()136     int getSkippedMandatoryShipmentCount();
137 
138     /**
139      *
140      *
141      * <pre>
142      * Number of vehicles used. Note: if a vehicle route is empty and
143      * [Vehicle.used_if_route_is_empty][google.cloud.optimization.v1.Vehicle.used_if_route_is_empty]
144      * is true, the vehicle is considered used.
145      * </pre>
146      *
147      * <code>int32 used_vehicle_count = 3;</code>
148      *
149      * @return The usedVehicleCount.
150      */
getUsedVehicleCount()151     int getUsedVehicleCount();
152 
153     /**
154      *
155      *
156      * <pre>
157      * The earliest start time for a used vehicle, computed as the minimum over
158      * all used vehicles of
159      * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
160      * </pre>
161      *
162      * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
163      *
164      * @return Whether the earliestVehicleStartTime field is set.
165      */
hasEarliestVehicleStartTime()166     boolean hasEarliestVehicleStartTime();
167     /**
168      *
169      *
170      * <pre>
171      * The earliest start time for a used vehicle, computed as the minimum over
172      * all used vehicles of
173      * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
174      * </pre>
175      *
176      * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
177      *
178      * @return The earliestVehicleStartTime.
179      */
getEarliestVehicleStartTime()180     com.google.protobuf.Timestamp getEarliestVehicleStartTime();
181     /**
182      *
183      *
184      * <pre>
185      * The earliest start time for a used vehicle, computed as the minimum over
186      * all used vehicles of
187      * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
188      * </pre>
189      *
190      * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
191      */
getEarliestVehicleStartTimeOrBuilder()192     com.google.protobuf.TimestampOrBuilder getEarliestVehicleStartTimeOrBuilder();
193 
194     /**
195      *
196      *
197      * <pre>
198      * The latest end time for a used vehicle, computed as the maximum over all
199      * used vehicles of
200      * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
201      * </pre>
202      *
203      * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
204      *
205      * @return Whether the latestVehicleEndTime field is set.
206      */
hasLatestVehicleEndTime()207     boolean hasLatestVehicleEndTime();
208     /**
209      *
210      *
211      * <pre>
212      * The latest end time for a used vehicle, computed as the maximum over all
213      * used vehicles of
214      * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
215      * </pre>
216      *
217      * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
218      *
219      * @return The latestVehicleEndTime.
220      */
getLatestVehicleEndTime()221     com.google.protobuf.Timestamp getLatestVehicleEndTime();
222     /**
223      *
224      *
225      * <pre>
226      * The latest end time for a used vehicle, computed as the maximum over all
227      * used vehicles of
228      * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
229      * </pre>
230      *
231      * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
232      */
getLatestVehicleEndTimeOrBuilder()233     com.google.protobuf.TimestampOrBuilder getLatestVehicleEndTimeOrBuilder();
234 
235     /**
236      *
237      *
238      * <pre>
239      * Cost of the solution, broken down by cost-related request fields.
240      * The keys are proto paths, relative to the input OptimizeToursRequest,
241      * e.g. "model.shipments.pickups.cost", and the values are the total cost
242      * generated by the corresponding cost field, aggregated over the whole
243      * solution. In other words, costs["model.shipments.pickups.cost"] is the
244      * sum of all pickup costs over the solution. All costs defined in the model
245      * are reported in detail here with the exception of costs related to
246      * TransitionAttributes that are only reported in an aggregated way as of
247      * 2022/01.
248      * </pre>
249      *
250      * <code>map&lt;string, double&gt; costs = 10;</code>
251      */
getCostsCount()252     int getCostsCount();
253     /**
254      *
255      *
256      * <pre>
257      * Cost of the solution, broken down by cost-related request fields.
258      * The keys are proto paths, relative to the input OptimizeToursRequest,
259      * e.g. "model.shipments.pickups.cost", and the values are the total cost
260      * generated by the corresponding cost field, aggregated over the whole
261      * solution. In other words, costs["model.shipments.pickups.cost"] is the
262      * sum of all pickup costs over the solution. All costs defined in the model
263      * are reported in detail here with the exception of costs related to
264      * TransitionAttributes that are only reported in an aggregated way as of
265      * 2022/01.
266      * </pre>
267      *
268      * <code>map&lt;string, double&gt; costs = 10;</code>
269      */
containsCosts(java.lang.String key)270     boolean containsCosts(java.lang.String key);
271     /** Use {@link #getCostsMap()} instead. */
272     @java.lang.Deprecated
getCosts()273     java.util.Map<java.lang.String, java.lang.Double> getCosts();
274     /**
275      *
276      *
277      * <pre>
278      * Cost of the solution, broken down by cost-related request fields.
279      * The keys are proto paths, relative to the input OptimizeToursRequest,
280      * e.g. "model.shipments.pickups.cost", and the values are the total cost
281      * generated by the corresponding cost field, aggregated over the whole
282      * solution. In other words, costs["model.shipments.pickups.cost"] is the
283      * sum of all pickup costs over the solution. All costs defined in the model
284      * are reported in detail here with the exception of costs related to
285      * TransitionAttributes that are only reported in an aggregated way as of
286      * 2022/01.
287      * </pre>
288      *
289      * <code>map&lt;string, double&gt; costs = 10;</code>
290      */
getCostsMap()291     java.util.Map<java.lang.String, java.lang.Double> getCostsMap();
292     /**
293      *
294      *
295      * <pre>
296      * Cost of the solution, broken down by cost-related request fields.
297      * The keys are proto paths, relative to the input OptimizeToursRequest,
298      * e.g. "model.shipments.pickups.cost", and the values are the total cost
299      * generated by the corresponding cost field, aggregated over the whole
300      * solution. In other words, costs["model.shipments.pickups.cost"] is the
301      * sum of all pickup costs over the solution. All costs defined in the model
302      * are reported in detail here with the exception of costs related to
303      * TransitionAttributes that are only reported in an aggregated way as of
304      * 2022/01.
305      * </pre>
306      *
307      * <code>map&lt;string, double&gt; costs = 10;</code>
308      */
getCostsOrDefault(java.lang.String key, double defaultValue)309     double getCostsOrDefault(java.lang.String key, double defaultValue);
310     /**
311      *
312      *
313      * <pre>
314      * Cost of the solution, broken down by cost-related request fields.
315      * The keys are proto paths, relative to the input OptimizeToursRequest,
316      * e.g. "model.shipments.pickups.cost", and the values are the total cost
317      * generated by the corresponding cost field, aggregated over the whole
318      * solution. In other words, costs["model.shipments.pickups.cost"] is the
319      * sum of all pickup costs over the solution. All costs defined in the model
320      * are reported in detail here with the exception of costs related to
321      * TransitionAttributes that are only reported in an aggregated way as of
322      * 2022/01.
323      * </pre>
324      *
325      * <code>map&lt;string, double&gt; costs = 10;</code>
326      */
getCostsOrThrow(java.lang.String key)327     double getCostsOrThrow(java.lang.String key);
328 
329     /**
330      *
331      *
332      * <pre>
333      * Total cost of the solution. The sum of all values in the costs map.
334      * </pre>
335      *
336      * <code>double total_cost = 6;</code>
337      *
338      * @return The totalCost.
339      */
getTotalCost()340     double getTotalCost();
341   }
342   /**
343    *
344    *
345    * <pre>
346    * Overall metrics, aggregated over all routes.
347    * </pre>
348    *
349    * Protobuf type {@code google.cloud.optimization.v1.OptimizeToursResponse.Metrics}
350    */
351   public static final class Metrics extends com.google.protobuf.GeneratedMessageV3
352       implements
353       // @@protoc_insertion_point(message_implements:google.cloud.optimization.v1.OptimizeToursResponse.Metrics)
354       MetricsOrBuilder {
355     private static final long serialVersionUID = 0L;
356     // Use Metrics.newBuilder() to construct.
Metrics(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)357     private Metrics(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
358       super(builder);
359     }
360 
Metrics()361     private Metrics() {}
362 
363     @java.lang.Override
364     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)365     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
366       return new Metrics();
367     }
368 
369     @java.lang.Override
getUnknownFields()370     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
371       return this.unknownFields;
372     }
373 
getDescriptor()374     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
375       return com.google.cloud.optimization.v1.FleetRoutingProto
376           .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_Metrics_descriptor;
377     }
378 
379     @SuppressWarnings({"rawtypes"})
380     @java.lang.Override
internalGetMapField(int number)381     protected com.google.protobuf.MapField internalGetMapField(int number) {
382       switch (number) {
383         case 10:
384           return internalGetCosts();
385         default:
386           throw new RuntimeException("Invalid map field number: " + number);
387       }
388     }
389 
390     @java.lang.Override
391     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()392         internalGetFieldAccessorTable() {
393       return com.google.cloud.optimization.v1.FleetRoutingProto
394           .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_Metrics_fieldAccessorTable
395           .ensureFieldAccessorsInitialized(
396               com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.class,
397               com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder.class);
398     }
399 
400     public static final int AGGREGATED_ROUTE_METRICS_FIELD_NUMBER = 1;
401     private com.google.cloud.optimization.v1.AggregatedMetrics aggregatedRouteMetrics_;
402     /**
403      *
404      *
405      * <pre>
406      * Aggregated over the routes. Each metric is the sum (or max, for loads)
407      * over all
408      * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
409      * fields of the same name.
410      * </pre>
411      *
412      * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
413      *
414      * @return Whether the aggregatedRouteMetrics field is set.
415      */
416     @java.lang.Override
hasAggregatedRouteMetrics()417     public boolean hasAggregatedRouteMetrics() {
418       return aggregatedRouteMetrics_ != null;
419     }
420     /**
421      *
422      *
423      * <pre>
424      * Aggregated over the routes. Each metric is the sum (or max, for loads)
425      * over all
426      * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
427      * fields of the same name.
428      * </pre>
429      *
430      * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
431      *
432      * @return The aggregatedRouteMetrics.
433      */
434     @java.lang.Override
getAggregatedRouteMetrics()435     public com.google.cloud.optimization.v1.AggregatedMetrics getAggregatedRouteMetrics() {
436       return aggregatedRouteMetrics_ == null
437           ? com.google.cloud.optimization.v1.AggregatedMetrics.getDefaultInstance()
438           : aggregatedRouteMetrics_;
439     }
440     /**
441      *
442      *
443      * <pre>
444      * Aggregated over the routes. Each metric is the sum (or max, for loads)
445      * over all
446      * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
447      * fields of the same name.
448      * </pre>
449      *
450      * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
451      */
452     @java.lang.Override
453     public com.google.cloud.optimization.v1.AggregatedMetricsOrBuilder
getAggregatedRouteMetricsOrBuilder()454         getAggregatedRouteMetricsOrBuilder() {
455       return aggregatedRouteMetrics_ == null
456           ? com.google.cloud.optimization.v1.AggregatedMetrics.getDefaultInstance()
457           : aggregatedRouteMetrics_;
458     }
459 
460     public static final int SKIPPED_MANDATORY_SHIPMENT_COUNT_FIELD_NUMBER = 2;
461     private int skippedMandatoryShipmentCount_ = 0;
462     /**
463      *
464      *
465      * <pre>
466      * Number of mandatory shipments skipped.
467      * </pre>
468      *
469      * <code>int32 skipped_mandatory_shipment_count = 2;</code>
470      *
471      * @return The skippedMandatoryShipmentCount.
472      */
473     @java.lang.Override
getSkippedMandatoryShipmentCount()474     public int getSkippedMandatoryShipmentCount() {
475       return skippedMandatoryShipmentCount_;
476     }
477 
478     public static final int USED_VEHICLE_COUNT_FIELD_NUMBER = 3;
479     private int usedVehicleCount_ = 0;
480     /**
481      *
482      *
483      * <pre>
484      * Number of vehicles used. Note: if a vehicle route is empty and
485      * [Vehicle.used_if_route_is_empty][google.cloud.optimization.v1.Vehicle.used_if_route_is_empty]
486      * is true, the vehicle is considered used.
487      * </pre>
488      *
489      * <code>int32 used_vehicle_count = 3;</code>
490      *
491      * @return The usedVehicleCount.
492      */
493     @java.lang.Override
getUsedVehicleCount()494     public int getUsedVehicleCount() {
495       return usedVehicleCount_;
496     }
497 
498     public static final int EARLIEST_VEHICLE_START_TIME_FIELD_NUMBER = 4;
499     private com.google.protobuf.Timestamp earliestVehicleStartTime_;
500     /**
501      *
502      *
503      * <pre>
504      * The earliest start time for a used vehicle, computed as the minimum over
505      * all used vehicles of
506      * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
507      * </pre>
508      *
509      * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
510      *
511      * @return Whether the earliestVehicleStartTime field is set.
512      */
513     @java.lang.Override
hasEarliestVehicleStartTime()514     public boolean hasEarliestVehicleStartTime() {
515       return earliestVehicleStartTime_ != null;
516     }
517     /**
518      *
519      *
520      * <pre>
521      * The earliest start time for a used vehicle, computed as the minimum over
522      * all used vehicles of
523      * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
524      * </pre>
525      *
526      * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
527      *
528      * @return The earliestVehicleStartTime.
529      */
530     @java.lang.Override
getEarliestVehicleStartTime()531     public com.google.protobuf.Timestamp getEarliestVehicleStartTime() {
532       return earliestVehicleStartTime_ == null
533           ? com.google.protobuf.Timestamp.getDefaultInstance()
534           : earliestVehicleStartTime_;
535     }
536     /**
537      *
538      *
539      * <pre>
540      * The earliest start time for a used vehicle, computed as the minimum over
541      * all used vehicles of
542      * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
543      * </pre>
544      *
545      * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
546      */
547     @java.lang.Override
getEarliestVehicleStartTimeOrBuilder()548     public com.google.protobuf.TimestampOrBuilder getEarliestVehicleStartTimeOrBuilder() {
549       return earliestVehicleStartTime_ == null
550           ? com.google.protobuf.Timestamp.getDefaultInstance()
551           : earliestVehicleStartTime_;
552     }
553 
554     public static final int LATEST_VEHICLE_END_TIME_FIELD_NUMBER = 5;
555     private com.google.protobuf.Timestamp latestVehicleEndTime_;
556     /**
557      *
558      *
559      * <pre>
560      * The latest end time for a used vehicle, computed as the maximum over all
561      * used vehicles of
562      * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
563      * </pre>
564      *
565      * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
566      *
567      * @return Whether the latestVehicleEndTime field is set.
568      */
569     @java.lang.Override
hasLatestVehicleEndTime()570     public boolean hasLatestVehicleEndTime() {
571       return latestVehicleEndTime_ != null;
572     }
573     /**
574      *
575      *
576      * <pre>
577      * The latest end time for a used vehicle, computed as the maximum over all
578      * used vehicles of
579      * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
580      * </pre>
581      *
582      * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
583      *
584      * @return The latestVehicleEndTime.
585      */
586     @java.lang.Override
getLatestVehicleEndTime()587     public com.google.protobuf.Timestamp getLatestVehicleEndTime() {
588       return latestVehicleEndTime_ == null
589           ? com.google.protobuf.Timestamp.getDefaultInstance()
590           : latestVehicleEndTime_;
591     }
592     /**
593      *
594      *
595      * <pre>
596      * The latest end time for a used vehicle, computed as the maximum over all
597      * used vehicles of
598      * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
599      * </pre>
600      *
601      * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
602      */
603     @java.lang.Override
getLatestVehicleEndTimeOrBuilder()604     public com.google.protobuf.TimestampOrBuilder getLatestVehicleEndTimeOrBuilder() {
605       return latestVehicleEndTime_ == null
606           ? com.google.protobuf.Timestamp.getDefaultInstance()
607           : latestVehicleEndTime_;
608     }
609 
610     public static final int COSTS_FIELD_NUMBER = 10;
611 
612     private static final class CostsDefaultEntryHolder {
613       static final com.google.protobuf.MapEntry<java.lang.String, java.lang.Double> defaultEntry =
614           com.google.protobuf.MapEntry.<java.lang.String, java.lang.Double>newDefaultInstance(
615               com.google.cloud.optimization.v1.FleetRoutingProto
616                   .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_Metrics_CostsEntry_descriptor,
617               com.google.protobuf.WireFormat.FieldType.STRING,
618               "",
619               com.google.protobuf.WireFormat.FieldType.DOUBLE,
620               0D);
621     }
622 
623     @SuppressWarnings("serial")
624     private com.google.protobuf.MapField<java.lang.String, java.lang.Double> costs_;
625 
internalGetCosts()626     private com.google.protobuf.MapField<java.lang.String, java.lang.Double> internalGetCosts() {
627       if (costs_ == null) {
628         return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry);
629       }
630       return costs_;
631     }
632 
getCostsCount()633     public int getCostsCount() {
634       return internalGetCosts().getMap().size();
635     }
636     /**
637      *
638      *
639      * <pre>
640      * Cost of the solution, broken down by cost-related request fields.
641      * The keys are proto paths, relative to the input OptimizeToursRequest,
642      * e.g. "model.shipments.pickups.cost", and the values are the total cost
643      * generated by the corresponding cost field, aggregated over the whole
644      * solution. In other words, costs["model.shipments.pickups.cost"] is the
645      * sum of all pickup costs over the solution. All costs defined in the model
646      * are reported in detail here with the exception of costs related to
647      * TransitionAttributes that are only reported in an aggregated way as of
648      * 2022/01.
649      * </pre>
650      *
651      * <code>map&lt;string, double&gt; costs = 10;</code>
652      */
653     @java.lang.Override
containsCosts(java.lang.String key)654     public boolean containsCosts(java.lang.String key) {
655       if (key == null) {
656         throw new NullPointerException("map key");
657       }
658       return internalGetCosts().getMap().containsKey(key);
659     }
660     /** Use {@link #getCostsMap()} instead. */
661     @java.lang.Override
662     @java.lang.Deprecated
getCosts()663     public java.util.Map<java.lang.String, java.lang.Double> getCosts() {
664       return getCostsMap();
665     }
666     /**
667      *
668      *
669      * <pre>
670      * Cost of the solution, broken down by cost-related request fields.
671      * The keys are proto paths, relative to the input OptimizeToursRequest,
672      * e.g. "model.shipments.pickups.cost", and the values are the total cost
673      * generated by the corresponding cost field, aggregated over the whole
674      * solution. In other words, costs["model.shipments.pickups.cost"] is the
675      * sum of all pickup costs over the solution. All costs defined in the model
676      * are reported in detail here with the exception of costs related to
677      * TransitionAttributes that are only reported in an aggregated way as of
678      * 2022/01.
679      * </pre>
680      *
681      * <code>map&lt;string, double&gt; costs = 10;</code>
682      */
683     @java.lang.Override
getCostsMap()684     public java.util.Map<java.lang.String, java.lang.Double> getCostsMap() {
685       return internalGetCosts().getMap();
686     }
687     /**
688      *
689      *
690      * <pre>
691      * Cost of the solution, broken down by cost-related request fields.
692      * The keys are proto paths, relative to the input OptimizeToursRequest,
693      * e.g. "model.shipments.pickups.cost", and the values are the total cost
694      * generated by the corresponding cost field, aggregated over the whole
695      * solution. In other words, costs["model.shipments.pickups.cost"] is the
696      * sum of all pickup costs over the solution. All costs defined in the model
697      * are reported in detail here with the exception of costs related to
698      * TransitionAttributes that are only reported in an aggregated way as of
699      * 2022/01.
700      * </pre>
701      *
702      * <code>map&lt;string, double&gt; costs = 10;</code>
703      */
704     @java.lang.Override
getCostsOrDefault(java.lang.String key, double defaultValue)705     public double getCostsOrDefault(java.lang.String key, double defaultValue) {
706       if (key == null) {
707         throw new NullPointerException("map key");
708       }
709       java.util.Map<java.lang.String, java.lang.Double> map = internalGetCosts().getMap();
710       return map.containsKey(key) ? map.get(key) : defaultValue;
711     }
712     /**
713      *
714      *
715      * <pre>
716      * Cost of the solution, broken down by cost-related request fields.
717      * The keys are proto paths, relative to the input OptimizeToursRequest,
718      * e.g. "model.shipments.pickups.cost", and the values are the total cost
719      * generated by the corresponding cost field, aggregated over the whole
720      * solution. In other words, costs["model.shipments.pickups.cost"] is the
721      * sum of all pickup costs over the solution. All costs defined in the model
722      * are reported in detail here with the exception of costs related to
723      * TransitionAttributes that are only reported in an aggregated way as of
724      * 2022/01.
725      * </pre>
726      *
727      * <code>map&lt;string, double&gt; costs = 10;</code>
728      */
729     @java.lang.Override
getCostsOrThrow(java.lang.String key)730     public double getCostsOrThrow(java.lang.String key) {
731       if (key == null) {
732         throw new NullPointerException("map key");
733       }
734       java.util.Map<java.lang.String, java.lang.Double> map = internalGetCosts().getMap();
735       if (!map.containsKey(key)) {
736         throw new java.lang.IllegalArgumentException();
737       }
738       return map.get(key);
739     }
740 
741     public static final int TOTAL_COST_FIELD_NUMBER = 6;
742     private double totalCost_ = 0D;
743     /**
744      *
745      *
746      * <pre>
747      * Total cost of the solution. The sum of all values in the costs map.
748      * </pre>
749      *
750      * <code>double total_cost = 6;</code>
751      *
752      * @return The totalCost.
753      */
754     @java.lang.Override
getTotalCost()755     public double getTotalCost() {
756       return totalCost_;
757     }
758 
759     private byte memoizedIsInitialized = -1;
760 
761     @java.lang.Override
isInitialized()762     public final boolean isInitialized() {
763       byte isInitialized = memoizedIsInitialized;
764       if (isInitialized == 1) return true;
765       if (isInitialized == 0) return false;
766 
767       memoizedIsInitialized = 1;
768       return true;
769     }
770 
771     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)772     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
773       if (aggregatedRouteMetrics_ != null) {
774         output.writeMessage(1, getAggregatedRouteMetrics());
775       }
776       if (skippedMandatoryShipmentCount_ != 0) {
777         output.writeInt32(2, skippedMandatoryShipmentCount_);
778       }
779       if (usedVehicleCount_ != 0) {
780         output.writeInt32(3, usedVehicleCount_);
781       }
782       if (earliestVehicleStartTime_ != null) {
783         output.writeMessage(4, getEarliestVehicleStartTime());
784       }
785       if (latestVehicleEndTime_ != null) {
786         output.writeMessage(5, getLatestVehicleEndTime());
787       }
788       if (java.lang.Double.doubleToRawLongBits(totalCost_) != 0) {
789         output.writeDouble(6, totalCost_);
790       }
791       com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
792           output, internalGetCosts(), CostsDefaultEntryHolder.defaultEntry, 10);
793       getUnknownFields().writeTo(output);
794     }
795 
796     @java.lang.Override
getSerializedSize()797     public int getSerializedSize() {
798       int size = memoizedSize;
799       if (size != -1) return size;
800 
801       size = 0;
802       if (aggregatedRouteMetrics_ != null) {
803         size +=
804             com.google.protobuf.CodedOutputStream.computeMessageSize(
805                 1, getAggregatedRouteMetrics());
806       }
807       if (skippedMandatoryShipmentCount_ != 0) {
808         size +=
809             com.google.protobuf.CodedOutputStream.computeInt32Size(
810                 2, skippedMandatoryShipmentCount_);
811       }
812       if (usedVehicleCount_ != 0) {
813         size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, usedVehicleCount_);
814       }
815       if (earliestVehicleStartTime_ != null) {
816         size +=
817             com.google.protobuf.CodedOutputStream.computeMessageSize(
818                 4, getEarliestVehicleStartTime());
819       }
820       if (latestVehicleEndTime_ != null) {
821         size +=
822             com.google.protobuf.CodedOutputStream.computeMessageSize(5, getLatestVehicleEndTime());
823       }
824       if (java.lang.Double.doubleToRawLongBits(totalCost_) != 0) {
825         size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, totalCost_);
826       }
827       for (java.util.Map.Entry<java.lang.String, java.lang.Double> entry :
828           internalGetCosts().getMap().entrySet()) {
829         com.google.protobuf.MapEntry<java.lang.String, java.lang.Double> costs__ =
830             CostsDefaultEntryHolder.defaultEntry
831                 .newBuilderForType()
832                 .setKey(entry.getKey())
833                 .setValue(entry.getValue())
834                 .build();
835         size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, costs__);
836       }
837       size += getUnknownFields().getSerializedSize();
838       memoizedSize = size;
839       return size;
840     }
841 
842     @java.lang.Override
equals(final java.lang.Object obj)843     public boolean equals(final java.lang.Object obj) {
844       if (obj == this) {
845         return true;
846       }
847       if (!(obj instanceof com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics)) {
848         return super.equals(obj);
849       }
850       com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics other =
851           (com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics) obj;
852 
853       if (hasAggregatedRouteMetrics() != other.hasAggregatedRouteMetrics()) return false;
854       if (hasAggregatedRouteMetrics()) {
855         if (!getAggregatedRouteMetrics().equals(other.getAggregatedRouteMetrics())) return false;
856       }
857       if (getSkippedMandatoryShipmentCount() != other.getSkippedMandatoryShipmentCount())
858         return false;
859       if (getUsedVehicleCount() != other.getUsedVehicleCount()) return false;
860       if (hasEarliestVehicleStartTime() != other.hasEarliestVehicleStartTime()) return false;
861       if (hasEarliestVehicleStartTime()) {
862         if (!getEarliestVehicleStartTime().equals(other.getEarliestVehicleStartTime()))
863           return false;
864       }
865       if (hasLatestVehicleEndTime() != other.hasLatestVehicleEndTime()) return false;
866       if (hasLatestVehicleEndTime()) {
867         if (!getLatestVehicleEndTime().equals(other.getLatestVehicleEndTime())) return false;
868       }
869       if (!internalGetCosts().equals(other.internalGetCosts())) return false;
870       if (java.lang.Double.doubleToLongBits(getTotalCost())
871           != java.lang.Double.doubleToLongBits(other.getTotalCost())) return false;
872       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
873       return true;
874     }
875 
876     @java.lang.Override
hashCode()877     public int hashCode() {
878       if (memoizedHashCode != 0) {
879         return memoizedHashCode;
880       }
881       int hash = 41;
882       hash = (19 * hash) + getDescriptor().hashCode();
883       if (hasAggregatedRouteMetrics()) {
884         hash = (37 * hash) + AGGREGATED_ROUTE_METRICS_FIELD_NUMBER;
885         hash = (53 * hash) + getAggregatedRouteMetrics().hashCode();
886       }
887       hash = (37 * hash) + SKIPPED_MANDATORY_SHIPMENT_COUNT_FIELD_NUMBER;
888       hash = (53 * hash) + getSkippedMandatoryShipmentCount();
889       hash = (37 * hash) + USED_VEHICLE_COUNT_FIELD_NUMBER;
890       hash = (53 * hash) + getUsedVehicleCount();
891       if (hasEarliestVehicleStartTime()) {
892         hash = (37 * hash) + EARLIEST_VEHICLE_START_TIME_FIELD_NUMBER;
893         hash = (53 * hash) + getEarliestVehicleStartTime().hashCode();
894       }
895       if (hasLatestVehicleEndTime()) {
896         hash = (37 * hash) + LATEST_VEHICLE_END_TIME_FIELD_NUMBER;
897         hash = (53 * hash) + getLatestVehicleEndTime().hashCode();
898       }
899       if (!internalGetCosts().getMap().isEmpty()) {
900         hash = (37 * hash) + COSTS_FIELD_NUMBER;
901         hash = (53 * hash) + internalGetCosts().hashCode();
902       }
903       hash = (37 * hash) + TOTAL_COST_FIELD_NUMBER;
904       hash =
905           (53 * hash)
906               + com.google.protobuf.Internal.hashLong(
907                   java.lang.Double.doubleToLongBits(getTotalCost()));
908       hash = (29 * hash) + getUnknownFields().hashCode();
909       memoizedHashCode = hash;
910       return hash;
911     }
912 
parseFrom( java.nio.ByteBuffer data)913     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
914         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
915       return PARSER.parseFrom(data);
916     }
917 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)918     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
919         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
920         throws com.google.protobuf.InvalidProtocolBufferException {
921       return PARSER.parseFrom(data, extensionRegistry);
922     }
923 
parseFrom( com.google.protobuf.ByteString data)924     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
925         com.google.protobuf.ByteString data)
926         throws com.google.protobuf.InvalidProtocolBufferException {
927       return PARSER.parseFrom(data);
928     }
929 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)930     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
931         com.google.protobuf.ByteString data,
932         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
933         throws com.google.protobuf.InvalidProtocolBufferException {
934       return PARSER.parseFrom(data, extensionRegistry);
935     }
936 
parseFrom( byte[] data)937     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
938         byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
939       return PARSER.parseFrom(data);
940     }
941 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)942     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
943         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
944         throws com.google.protobuf.InvalidProtocolBufferException {
945       return PARSER.parseFrom(data, extensionRegistry);
946     }
947 
parseFrom( java.io.InputStream input)948     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
949         java.io.InputStream input) throws java.io.IOException {
950       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
951     }
952 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)953     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
954         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
955         throws java.io.IOException {
956       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
957           PARSER, input, extensionRegistry);
958     }
959 
parseDelimitedFrom( java.io.InputStream input)960     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseDelimitedFrom(
961         java.io.InputStream input) throws java.io.IOException {
962       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
963     }
964 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)965     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseDelimitedFrom(
966         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
967         throws java.io.IOException {
968       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
969           PARSER, input, extensionRegistry);
970     }
971 
parseFrom( com.google.protobuf.CodedInputStream input)972     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
973         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
974       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
975     }
976 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)977     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics parseFrom(
978         com.google.protobuf.CodedInputStream input,
979         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
980         throws java.io.IOException {
981       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
982           PARSER, input, extensionRegistry);
983     }
984 
985     @java.lang.Override
newBuilderForType()986     public Builder newBuilderForType() {
987       return newBuilder();
988     }
989 
newBuilder()990     public static Builder newBuilder() {
991       return DEFAULT_INSTANCE.toBuilder();
992     }
993 
newBuilder( com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics prototype)994     public static Builder newBuilder(
995         com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics prototype) {
996       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
997     }
998 
999     @java.lang.Override
toBuilder()1000     public Builder toBuilder() {
1001       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
1002     }
1003 
1004     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1005     protected Builder newBuilderForType(
1006         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1007       Builder builder = new Builder(parent);
1008       return builder;
1009     }
1010     /**
1011      *
1012      *
1013      * <pre>
1014      * Overall metrics, aggregated over all routes.
1015      * </pre>
1016      *
1017      * Protobuf type {@code google.cloud.optimization.v1.OptimizeToursResponse.Metrics}
1018      */
1019     public static final class Builder
1020         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
1021         implements
1022         // @@protoc_insertion_point(builder_implements:google.cloud.optimization.v1.OptimizeToursResponse.Metrics)
1023         com.google.cloud.optimization.v1.OptimizeToursResponse.MetricsOrBuilder {
getDescriptor()1024       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1025         return com.google.cloud.optimization.v1.FleetRoutingProto
1026             .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_Metrics_descriptor;
1027       }
1028 
1029       @SuppressWarnings({"rawtypes"})
internalGetMapField(int number)1030       protected com.google.protobuf.MapField internalGetMapField(int number) {
1031         switch (number) {
1032           case 10:
1033             return internalGetCosts();
1034           default:
1035             throw new RuntimeException("Invalid map field number: " + number);
1036         }
1037       }
1038 
1039       @SuppressWarnings({"rawtypes"})
internalGetMutableMapField(int number)1040       protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
1041         switch (number) {
1042           case 10:
1043             return internalGetMutableCosts();
1044           default:
1045             throw new RuntimeException("Invalid map field number: " + number);
1046         }
1047       }
1048 
1049       @java.lang.Override
1050       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1051           internalGetFieldAccessorTable() {
1052         return com.google.cloud.optimization.v1.FleetRoutingProto
1053             .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_Metrics_fieldAccessorTable
1054             .ensureFieldAccessorsInitialized(
1055                 com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.class,
1056                 com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder.class);
1057       }
1058 
1059       // Construct using com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.newBuilder()
Builder()1060       private Builder() {}
1061 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1062       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1063         super(parent);
1064       }
1065 
1066       @java.lang.Override
clear()1067       public Builder clear() {
1068         super.clear();
1069         bitField0_ = 0;
1070         aggregatedRouteMetrics_ = null;
1071         if (aggregatedRouteMetricsBuilder_ != null) {
1072           aggregatedRouteMetricsBuilder_.dispose();
1073           aggregatedRouteMetricsBuilder_ = null;
1074         }
1075         skippedMandatoryShipmentCount_ = 0;
1076         usedVehicleCount_ = 0;
1077         earliestVehicleStartTime_ = null;
1078         if (earliestVehicleStartTimeBuilder_ != null) {
1079           earliestVehicleStartTimeBuilder_.dispose();
1080           earliestVehicleStartTimeBuilder_ = null;
1081         }
1082         latestVehicleEndTime_ = null;
1083         if (latestVehicleEndTimeBuilder_ != null) {
1084           latestVehicleEndTimeBuilder_.dispose();
1085           latestVehicleEndTimeBuilder_ = null;
1086         }
1087         internalGetMutableCosts().clear();
1088         totalCost_ = 0D;
1089         return this;
1090       }
1091 
1092       @java.lang.Override
getDescriptorForType()1093       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1094         return com.google.cloud.optimization.v1.FleetRoutingProto
1095             .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_Metrics_descriptor;
1096       }
1097 
1098       @java.lang.Override
1099       public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics
getDefaultInstanceForType()1100           getDefaultInstanceForType() {
1101         return com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance();
1102       }
1103 
1104       @java.lang.Override
build()1105       public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics build() {
1106         com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics result = buildPartial();
1107         if (!result.isInitialized()) {
1108           throw newUninitializedMessageException(result);
1109         }
1110         return result;
1111       }
1112 
1113       @java.lang.Override
buildPartial()1114       public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics buildPartial() {
1115         com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics result =
1116             new com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics(this);
1117         if (bitField0_ != 0) {
1118           buildPartial0(result);
1119         }
1120         onBuilt();
1121         return result;
1122       }
1123 
buildPartial0( com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics result)1124       private void buildPartial0(
1125           com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics result) {
1126         int from_bitField0_ = bitField0_;
1127         if (((from_bitField0_ & 0x00000001) != 0)) {
1128           result.aggregatedRouteMetrics_ =
1129               aggregatedRouteMetricsBuilder_ == null
1130                   ? aggregatedRouteMetrics_
1131                   : aggregatedRouteMetricsBuilder_.build();
1132         }
1133         if (((from_bitField0_ & 0x00000002) != 0)) {
1134           result.skippedMandatoryShipmentCount_ = skippedMandatoryShipmentCount_;
1135         }
1136         if (((from_bitField0_ & 0x00000004) != 0)) {
1137           result.usedVehicleCount_ = usedVehicleCount_;
1138         }
1139         if (((from_bitField0_ & 0x00000008) != 0)) {
1140           result.earliestVehicleStartTime_ =
1141               earliestVehicleStartTimeBuilder_ == null
1142                   ? earliestVehicleStartTime_
1143                   : earliestVehicleStartTimeBuilder_.build();
1144         }
1145         if (((from_bitField0_ & 0x00000010) != 0)) {
1146           result.latestVehicleEndTime_ =
1147               latestVehicleEndTimeBuilder_ == null
1148                   ? latestVehicleEndTime_
1149                   : latestVehicleEndTimeBuilder_.build();
1150         }
1151         if (((from_bitField0_ & 0x00000020) != 0)) {
1152           result.costs_ = internalGetCosts();
1153           result.costs_.makeImmutable();
1154         }
1155         if (((from_bitField0_ & 0x00000040) != 0)) {
1156           result.totalCost_ = totalCost_;
1157         }
1158       }
1159 
1160       @java.lang.Override
clone()1161       public Builder clone() {
1162         return super.clone();
1163       }
1164 
1165       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1166       public Builder setField(
1167           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1168         return super.setField(field, value);
1169       }
1170 
1171       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1172       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1173         return super.clearField(field);
1174       }
1175 
1176       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1177       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1178         return super.clearOneof(oneof);
1179       }
1180 
1181       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1182       public Builder setRepeatedField(
1183           com.google.protobuf.Descriptors.FieldDescriptor field,
1184           int index,
1185           java.lang.Object value) {
1186         return super.setRepeatedField(field, index, value);
1187       }
1188 
1189       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1190       public Builder addRepeatedField(
1191           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1192         return super.addRepeatedField(field, value);
1193       }
1194 
1195       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1196       public Builder mergeFrom(com.google.protobuf.Message other) {
1197         if (other instanceof com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics) {
1198           return mergeFrom((com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics) other);
1199         } else {
1200           super.mergeFrom(other);
1201           return this;
1202         }
1203       }
1204 
mergeFrom( com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics other)1205       public Builder mergeFrom(
1206           com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics other) {
1207         if (other
1208             == com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance())
1209           return this;
1210         if (other.hasAggregatedRouteMetrics()) {
1211           mergeAggregatedRouteMetrics(other.getAggregatedRouteMetrics());
1212         }
1213         if (other.getSkippedMandatoryShipmentCount() != 0) {
1214           setSkippedMandatoryShipmentCount(other.getSkippedMandatoryShipmentCount());
1215         }
1216         if (other.getUsedVehicleCount() != 0) {
1217           setUsedVehicleCount(other.getUsedVehicleCount());
1218         }
1219         if (other.hasEarliestVehicleStartTime()) {
1220           mergeEarliestVehicleStartTime(other.getEarliestVehicleStartTime());
1221         }
1222         if (other.hasLatestVehicleEndTime()) {
1223           mergeLatestVehicleEndTime(other.getLatestVehicleEndTime());
1224         }
1225         internalGetMutableCosts().mergeFrom(other.internalGetCosts());
1226         bitField0_ |= 0x00000020;
1227         if (other.getTotalCost() != 0D) {
1228           setTotalCost(other.getTotalCost());
1229         }
1230         this.mergeUnknownFields(other.getUnknownFields());
1231         onChanged();
1232         return this;
1233       }
1234 
1235       @java.lang.Override
isInitialized()1236       public final boolean isInitialized() {
1237         return true;
1238       }
1239 
1240       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1241       public Builder mergeFrom(
1242           com.google.protobuf.CodedInputStream input,
1243           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1244           throws java.io.IOException {
1245         if (extensionRegistry == null) {
1246           throw new java.lang.NullPointerException();
1247         }
1248         try {
1249           boolean done = false;
1250           while (!done) {
1251             int tag = input.readTag();
1252             switch (tag) {
1253               case 0:
1254                 done = true;
1255                 break;
1256               case 10:
1257                 {
1258                   input.readMessage(
1259                       getAggregatedRouteMetricsFieldBuilder().getBuilder(), extensionRegistry);
1260                   bitField0_ |= 0x00000001;
1261                   break;
1262                 } // case 10
1263               case 16:
1264                 {
1265                   skippedMandatoryShipmentCount_ = input.readInt32();
1266                   bitField0_ |= 0x00000002;
1267                   break;
1268                 } // case 16
1269               case 24:
1270                 {
1271                   usedVehicleCount_ = input.readInt32();
1272                   bitField0_ |= 0x00000004;
1273                   break;
1274                 } // case 24
1275               case 34:
1276                 {
1277                   input.readMessage(
1278                       getEarliestVehicleStartTimeFieldBuilder().getBuilder(), extensionRegistry);
1279                   bitField0_ |= 0x00000008;
1280                   break;
1281                 } // case 34
1282               case 42:
1283                 {
1284                   input.readMessage(
1285                       getLatestVehicleEndTimeFieldBuilder().getBuilder(), extensionRegistry);
1286                   bitField0_ |= 0x00000010;
1287                   break;
1288                 } // case 42
1289               case 49:
1290                 {
1291                   totalCost_ = input.readDouble();
1292                   bitField0_ |= 0x00000040;
1293                   break;
1294                 } // case 49
1295               case 82:
1296                 {
1297                   com.google.protobuf.MapEntry<java.lang.String, java.lang.Double> costs__ =
1298                       input.readMessage(
1299                           CostsDefaultEntryHolder.defaultEntry.getParserForType(),
1300                           extensionRegistry);
1301                   internalGetMutableCosts()
1302                       .getMutableMap()
1303                       .put(costs__.getKey(), costs__.getValue());
1304                   bitField0_ |= 0x00000020;
1305                   break;
1306                 } // case 82
1307               default:
1308                 {
1309                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1310                     done = true; // was an endgroup tag
1311                   }
1312                   break;
1313                 } // default:
1314             } // switch (tag)
1315           } // while (!done)
1316         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1317           throw e.unwrapIOException();
1318         } finally {
1319           onChanged();
1320         } // finally
1321         return this;
1322       }
1323 
1324       private int bitField0_;
1325 
1326       private com.google.cloud.optimization.v1.AggregatedMetrics aggregatedRouteMetrics_;
1327       private com.google.protobuf.SingleFieldBuilderV3<
1328               com.google.cloud.optimization.v1.AggregatedMetrics,
1329               com.google.cloud.optimization.v1.AggregatedMetrics.Builder,
1330               com.google.cloud.optimization.v1.AggregatedMetricsOrBuilder>
1331           aggregatedRouteMetricsBuilder_;
1332       /**
1333        *
1334        *
1335        * <pre>
1336        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1337        * over all
1338        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1339        * fields of the same name.
1340        * </pre>
1341        *
1342        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1343        *
1344        * @return Whether the aggregatedRouteMetrics field is set.
1345        */
hasAggregatedRouteMetrics()1346       public boolean hasAggregatedRouteMetrics() {
1347         return ((bitField0_ & 0x00000001) != 0);
1348       }
1349       /**
1350        *
1351        *
1352        * <pre>
1353        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1354        * over all
1355        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1356        * fields of the same name.
1357        * </pre>
1358        *
1359        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1360        *
1361        * @return The aggregatedRouteMetrics.
1362        */
getAggregatedRouteMetrics()1363       public com.google.cloud.optimization.v1.AggregatedMetrics getAggregatedRouteMetrics() {
1364         if (aggregatedRouteMetricsBuilder_ == null) {
1365           return aggregatedRouteMetrics_ == null
1366               ? com.google.cloud.optimization.v1.AggregatedMetrics.getDefaultInstance()
1367               : aggregatedRouteMetrics_;
1368         } else {
1369           return aggregatedRouteMetricsBuilder_.getMessage();
1370         }
1371       }
1372       /**
1373        *
1374        *
1375        * <pre>
1376        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1377        * over all
1378        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1379        * fields of the same name.
1380        * </pre>
1381        *
1382        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1383        */
setAggregatedRouteMetrics( com.google.cloud.optimization.v1.AggregatedMetrics value)1384       public Builder setAggregatedRouteMetrics(
1385           com.google.cloud.optimization.v1.AggregatedMetrics value) {
1386         if (aggregatedRouteMetricsBuilder_ == null) {
1387           if (value == null) {
1388             throw new NullPointerException();
1389           }
1390           aggregatedRouteMetrics_ = value;
1391         } else {
1392           aggregatedRouteMetricsBuilder_.setMessage(value);
1393         }
1394         bitField0_ |= 0x00000001;
1395         onChanged();
1396         return this;
1397       }
1398       /**
1399        *
1400        *
1401        * <pre>
1402        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1403        * over all
1404        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1405        * fields of the same name.
1406        * </pre>
1407        *
1408        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1409        */
setAggregatedRouteMetrics( com.google.cloud.optimization.v1.AggregatedMetrics.Builder builderForValue)1410       public Builder setAggregatedRouteMetrics(
1411           com.google.cloud.optimization.v1.AggregatedMetrics.Builder builderForValue) {
1412         if (aggregatedRouteMetricsBuilder_ == null) {
1413           aggregatedRouteMetrics_ = builderForValue.build();
1414         } else {
1415           aggregatedRouteMetricsBuilder_.setMessage(builderForValue.build());
1416         }
1417         bitField0_ |= 0x00000001;
1418         onChanged();
1419         return this;
1420       }
1421       /**
1422        *
1423        *
1424        * <pre>
1425        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1426        * over all
1427        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1428        * fields of the same name.
1429        * </pre>
1430        *
1431        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1432        */
mergeAggregatedRouteMetrics( com.google.cloud.optimization.v1.AggregatedMetrics value)1433       public Builder mergeAggregatedRouteMetrics(
1434           com.google.cloud.optimization.v1.AggregatedMetrics value) {
1435         if (aggregatedRouteMetricsBuilder_ == null) {
1436           if (((bitField0_ & 0x00000001) != 0)
1437               && aggregatedRouteMetrics_ != null
1438               && aggregatedRouteMetrics_
1439                   != com.google.cloud.optimization.v1.AggregatedMetrics.getDefaultInstance()) {
1440             getAggregatedRouteMetricsBuilder().mergeFrom(value);
1441           } else {
1442             aggregatedRouteMetrics_ = value;
1443           }
1444         } else {
1445           aggregatedRouteMetricsBuilder_.mergeFrom(value);
1446         }
1447         bitField0_ |= 0x00000001;
1448         onChanged();
1449         return this;
1450       }
1451       /**
1452        *
1453        *
1454        * <pre>
1455        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1456        * over all
1457        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1458        * fields of the same name.
1459        * </pre>
1460        *
1461        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1462        */
clearAggregatedRouteMetrics()1463       public Builder clearAggregatedRouteMetrics() {
1464         bitField0_ = (bitField0_ & ~0x00000001);
1465         aggregatedRouteMetrics_ = null;
1466         if (aggregatedRouteMetricsBuilder_ != null) {
1467           aggregatedRouteMetricsBuilder_.dispose();
1468           aggregatedRouteMetricsBuilder_ = null;
1469         }
1470         onChanged();
1471         return this;
1472       }
1473       /**
1474        *
1475        *
1476        * <pre>
1477        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1478        * over all
1479        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1480        * fields of the same name.
1481        * </pre>
1482        *
1483        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1484        */
1485       public com.google.cloud.optimization.v1.AggregatedMetrics.Builder
getAggregatedRouteMetricsBuilder()1486           getAggregatedRouteMetricsBuilder() {
1487         bitField0_ |= 0x00000001;
1488         onChanged();
1489         return getAggregatedRouteMetricsFieldBuilder().getBuilder();
1490       }
1491       /**
1492        *
1493        *
1494        * <pre>
1495        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1496        * over all
1497        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1498        * fields of the same name.
1499        * </pre>
1500        *
1501        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1502        */
1503       public com.google.cloud.optimization.v1.AggregatedMetricsOrBuilder
getAggregatedRouteMetricsOrBuilder()1504           getAggregatedRouteMetricsOrBuilder() {
1505         if (aggregatedRouteMetricsBuilder_ != null) {
1506           return aggregatedRouteMetricsBuilder_.getMessageOrBuilder();
1507         } else {
1508           return aggregatedRouteMetrics_ == null
1509               ? com.google.cloud.optimization.v1.AggregatedMetrics.getDefaultInstance()
1510               : aggregatedRouteMetrics_;
1511         }
1512       }
1513       /**
1514        *
1515        *
1516        * <pre>
1517        * Aggregated over the routes. Each metric is the sum (or max, for loads)
1518        * over all
1519        * [ShipmentRoute.metrics][google.cloud.optimization.v1.ShipmentRoute.metrics]
1520        * fields of the same name.
1521        * </pre>
1522        *
1523        * <code>.google.cloud.optimization.v1.AggregatedMetrics aggregated_route_metrics = 1;</code>
1524        */
1525       private com.google.protobuf.SingleFieldBuilderV3<
1526               com.google.cloud.optimization.v1.AggregatedMetrics,
1527               com.google.cloud.optimization.v1.AggregatedMetrics.Builder,
1528               com.google.cloud.optimization.v1.AggregatedMetricsOrBuilder>
getAggregatedRouteMetricsFieldBuilder()1529           getAggregatedRouteMetricsFieldBuilder() {
1530         if (aggregatedRouteMetricsBuilder_ == null) {
1531           aggregatedRouteMetricsBuilder_ =
1532               new com.google.protobuf.SingleFieldBuilderV3<
1533                   com.google.cloud.optimization.v1.AggregatedMetrics,
1534                   com.google.cloud.optimization.v1.AggregatedMetrics.Builder,
1535                   com.google.cloud.optimization.v1.AggregatedMetricsOrBuilder>(
1536                   getAggregatedRouteMetrics(), getParentForChildren(), isClean());
1537           aggregatedRouteMetrics_ = null;
1538         }
1539         return aggregatedRouteMetricsBuilder_;
1540       }
1541 
1542       private int skippedMandatoryShipmentCount_;
1543       /**
1544        *
1545        *
1546        * <pre>
1547        * Number of mandatory shipments skipped.
1548        * </pre>
1549        *
1550        * <code>int32 skipped_mandatory_shipment_count = 2;</code>
1551        *
1552        * @return The skippedMandatoryShipmentCount.
1553        */
1554       @java.lang.Override
getSkippedMandatoryShipmentCount()1555       public int getSkippedMandatoryShipmentCount() {
1556         return skippedMandatoryShipmentCount_;
1557       }
1558       /**
1559        *
1560        *
1561        * <pre>
1562        * Number of mandatory shipments skipped.
1563        * </pre>
1564        *
1565        * <code>int32 skipped_mandatory_shipment_count = 2;</code>
1566        *
1567        * @param value The skippedMandatoryShipmentCount to set.
1568        * @return This builder for chaining.
1569        */
setSkippedMandatoryShipmentCount(int value)1570       public Builder setSkippedMandatoryShipmentCount(int value) {
1571 
1572         skippedMandatoryShipmentCount_ = value;
1573         bitField0_ |= 0x00000002;
1574         onChanged();
1575         return this;
1576       }
1577       /**
1578        *
1579        *
1580        * <pre>
1581        * Number of mandatory shipments skipped.
1582        * </pre>
1583        *
1584        * <code>int32 skipped_mandatory_shipment_count = 2;</code>
1585        *
1586        * @return This builder for chaining.
1587        */
clearSkippedMandatoryShipmentCount()1588       public Builder clearSkippedMandatoryShipmentCount() {
1589         bitField0_ = (bitField0_ & ~0x00000002);
1590         skippedMandatoryShipmentCount_ = 0;
1591         onChanged();
1592         return this;
1593       }
1594 
1595       private int usedVehicleCount_;
1596       /**
1597        *
1598        *
1599        * <pre>
1600        * Number of vehicles used. Note: if a vehicle route is empty and
1601        * [Vehicle.used_if_route_is_empty][google.cloud.optimization.v1.Vehicle.used_if_route_is_empty]
1602        * is true, the vehicle is considered used.
1603        * </pre>
1604        *
1605        * <code>int32 used_vehicle_count = 3;</code>
1606        *
1607        * @return The usedVehicleCount.
1608        */
1609       @java.lang.Override
getUsedVehicleCount()1610       public int getUsedVehicleCount() {
1611         return usedVehicleCount_;
1612       }
1613       /**
1614        *
1615        *
1616        * <pre>
1617        * Number of vehicles used. Note: if a vehicle route is empty and
1618        * [Vehicle.used_if_route_is_empty][google.cloud.optimization.v1.Vehicle.used_if_route_is_empty]
1619        * is true, the vehicle is considered used.
1620        * </pre>
1621        *
1622        * <code>int32 used_vehicle_count = 3;</code>
1623        *
1624        * @param value The usedVehicleCount to set.
1625        * @return This builder for chaining.
1626        */
setUsedVehicleCount(int value)1627       public Builder setUsedVehicleCount(int value) {
1628 
1629         usedVehicleCount_ = value;
1630         bitField0_ |= 0x00000004;
1631         onChanged();
1632         return this;
1633       }
1634       /**
1635        *
1636        *
1637        * <pre>
1638        * Number of vehicles used. Note: if a vehicle route is empty and
1639        * [Vehicle.used_if_route_is_empty][google.cloud.optimization.v1.Vehicle.used_if_route_is_empty]
1640        * is true, the vehicle is considered used.
1641        * </pre>
1642        *
1643        * <code>int32 used_vehicle_count = 3;</code>
1644        *
1645        * @return This builder for chaining.
1646        */
clearUsedVehicleCount()1647       public Builder clearUsedVehicleCount() {
1648         bitField0_ = (bitField0_ & ~0x00000004);
1649         usedVehicleCount_ = 0;
1650         onChanged();
1651         return this;
1652       }
1653 
1654       private com.google.protobuf.Timestamp earliestVehicleStartTime_;
1655       private com.google.protobuf.SingleFieldBuilderV3<
1656               com.google.protobuf.Timestamp,
1657               com.google.protobuf.Timestamp.Builder,
1658               com.google.protobuf.TimestampOrBuilder>
1659           earliestVehicleStartTimeBuilder_;
1660       /**
1661        *
1662        *
1663        * <pre>
1664        * The earliest start time for a used vehicle, computed as the minimum over
1665        * all used vehicles of
1666        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1667        * </pre>
1668        *
1669        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1670        *
1671        * @return Whether the earliestVehicleStartTime field is set.
1672        */
hasEarliestVehicleStartTime()1673       public boolean hasEarliestVehicleStartTime() {
1674         return ((bitField0_ & 0x00000008) != 0);
1675       }
1676       /**
1677        *
1678        *
1679        * <pre>
1680        * The earliest start time for a used vehicle, computed as the minimum over
1681        * all used vehicles of
1682        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1683        * </pre>
1684        *
1685        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1686        *
1687        * @return The earliestVehicleStartTime.
1688        */
getEarliestVehicleStartTime()1689       public com.google.protobuf.Timestamp getEarliestVehicleStartTime() {
1690         if (earliestVehicleStartTimeBuilder_ == null) {
1691           return earliestVehicleStartTime_ == null
1692               ? com.google.protobuf.Timestamp.getDefaultInstance()
1693               : earliestVehicleStartTime_;
1694         } else {
1695           return earliestVehicleStartTimeBuilder_.getMessage();
1696         }
1697       }
1698       /**
1699        *
1700        *
1701        * <pre>
1702        * The earliest start time for a used vehicle, computed as the minimum over
1703        * all used vehicles of
1704        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1705        * </pre>
1706        *
1707        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1708        */
setEarliestVehicleStartTime(com.google.protobuf.Timestamp value)1709       public Builder setEarliestVehicleStartTime(com.google.protobuf.Timestamp value) {
1710         if (earliestVehicleStartTimeBuilder_ == null) {
1711           if (value == null) {
1712             throw new NullPointerException();
1713           }
1714           earliestVehicleStartTime_ = value;
1715         } else {
1716           earliestVehicleStartTimeBuilder_.setMessage(value);
1717         }
1718         bitField0_ |= 0x00000008;
1719         onChanged();
1720         return this;
1721       }
1722       /**
1723        *
1724        *
1725        * <pre>
1726        * The earliest start time for a used vehicle, computed as the minimum over
1727        * all used vehicles of
1728        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1729        * </pre>
1730        *
1731        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1732        */
setEarliestVehicleStartTime( com.google.protobuf.Timestamp.Builder builderForValue)1733       public Builder setEarliestVehicleStartTime(
1734           com.google.protobuf.Timestamp.Builder builderForValue) {
1735         if (earliestVehicleStartTimeBuilder_ == null) {
1736           earliestVehicleStartTime_ = builderForValue.build();
1737         } else {
1738           earliestVehicleStartTimeBuilder_.setMessage(builderForValue.build());
1739         }
1740         bitField0_ |= 0x00000008;
1741         onChanged();
1742         return this;
1743       }
1744       /**
1745        *
1746        *
1747        * <pre>
1748        * The earliest start time for a used vehicle, computed as the minimum over
1749        * all used vehicles of
1750        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1751        * </pre>
1752        *
1753        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1754        */
mergeEarliestVehicleStartTime(com.google.protobuf.Timestamp value)1755       public Builder mergeEarliestVehicleStartTime(com.google.protobuf.Timestamp value) {
1756         if (earliestVehicleStartTimeBuilder_ == null) {
1757           if (((bitField0_ & 0x00000008) != 0)
1758               && earliestVehicleStartTime_ != null
1759               && earliestVehicleStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
1760             getEarliestVehicleStartTimeBuilder().mergeFrom(value);
1761           } else {
1762             earliestVehicleStartTime_ = value;
1763           }
1764         } else {
1765           earliestVehicleStartTimeBuilder_.mergeFrom(value);
1766         }
1767         bitField0_ |= 0x00000008;
1768         onChanged();
1769         return this;
1770       }
1771       /**
1772        *
1773        *
1774        * <pre>
1775        * The earliest start time for a used vehicle, computed as the minimum over
1776        * all used vehicles of
1777        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1778        * </pre>
1779        *
1780        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1781        */
clearEarliestVehicleStartTime()1782       public Builder clearEarliestVehicleStartTime() {
1783         bitField0_ = (bitField0_ & ~0x00000008);
1784         earliestVehicleStartTime_ = null;
1785         if (earliestVehicleStartTimeBuilder_ != null) {
1786           earliestVehicleStartTimeBuilder_.dispose();
1787           earliestVehicleStartTimeBuilder_ = null;
1788         }
1789         onChanged();
1790         return this;
1791       }
1792       /**
1793        *
1794        *
1795        * <pre>
1796        * The earliest start time for a used vehicle, computed as the minimum over
1797        * all used vehicles of
1798        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1799        * </pre>
1800        *
1801        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1802        */
getEarliestVehicleStartTimeBuilder()1803       public com.google.protobuf.Timestamp.Builder getEarliestVehicleStartTimeBuilder() {
1804         bitField0_ |= 0x00000008;
1805         onChanged();
1806         return getEarliestVehicleStartTimeFieldBuilder().getBuilder();
1807       }
1808       /**
1809        *
1810        *
1811        * <pre>
1812        * The earliest start time for a used vehicle, computed as the minimum over
1813        * all used vehicles of
1814        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1815        * </pre>
1816        *
1817        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1818        */
getEarliestVehicleStartTimeOrBuilder()1819       public com.google.protobuf.TimestampOrBuilder getEarliestVehicleStartTimeOrBuilder() {
1820         if (earliestVehicleStartTimeBuilder_ != null) {
1821           return earliestVehicleStartTimeBuilder_.getMessageOrBuilder();
1822         } else {
1823           return earliestVehicleStartTime_ == null
1824               ? com.google.protobuf.Timestamp.getDefaultInstance()
1825               : earliestVehicleStartTime_;
1826         }
1827       }
1828       /**
1829        *
1830        *
1831        * <pre>
1832        * The earliest start time for a used vehicle, computed as the minimum over
1833        * all used vehicles of
1834        * [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time].
1835        * </pre>
1836        *
1837        * <code>.google.protobuf.Timestamp earliest_vehicle_start_time = 4;</code>
1838        */
1839       private com.google.protobuf.SingleFieldBuilderV3<
1840               com.google.protobuf.Timestamp,
1841               com.google.protobuf.Timestamp.Builder,
1842               com.google.protobuf.TimestampOrBuilder>
getEarliestVehicleStartTimeFieldBuilder()1843           getEarliestVehicleStartTimeFieldBuilder() {
1844         if (earliestVehicleStartTimeBuilder_ == null) {
1845           earliestVehicleStartTimeBuilder_ =
1846               new com.google.protobuf.SingleFieldBuilderV3<
1847                   com.google.protobuf.Timestamp,
1848                   com.google.protobuf.Timestamp.Builder,
1849                   com.google.protobuf.TimestampOrBuilder>(
1850                   getEarliestVehicleStartTime(), getParentForChildren(), isClean());
1851           earliestVehicleStartTime_ = null;
1852         }
1853         return earliestVehicleStartTimeBuilder_;
1854       }
1855 
1856       private com.google.protobuf.Timestamp latestVehicleEndTime_;
1857       private com.google.protobuf.SingleFieldBuilderV3<
1858               com.google.protobuf.Timestamp,
1859               com.google.protobuf.Timestamp.Builder,
1860               com.google.protobuf.TimestampOrBuilder>
1861           latestVehicleEndTimeBuilder_;
1862       /**
1863        *
1864        *
1865        * <pre>
1866        * The latest end time for a used vehicle, computed as the maximum over all
1867        * used vehicles of
1868        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
1869        * </pre>
1870        *
1871        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
1872        *
1873        * @return Whether the latestVehicleEndTime field is set.
1874        */
hasLatestVehicleEndTime()1875       public boolean hasLatestVehicleEndTime() {
1876         return ((bitField0_ & 0x00000010) != 0);
1877       }
1878       /**
1879        *
1880        *
1881        * <pre>
1882        * The latest end time for a used vehicle, computed as the maximum over all
1883        * used vehicles of
1884        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
1885        * </pre>
1886        *
1887        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
1888        *
1889        * @return The latestVehicleEndTime.
1890        */
getLatestVehicleEndTime()1891       public com.google.protobuf.Timestamp getLatestVehicleEndTime() {
1892         if (latestVehicleEndTimeBuilder_ == null) {
1893           return latestVehicleEndTime_ == null
1894               ? com.google.protobuf.Timestamp.getDefaultInstance()
1895               : latestVehicleEndTime_;
1896         } else {
1897           return latestVehicleEndTimeBuilder_.getMessage();
1898         }
1899       }
1900       /**
1901        *
1902        *
1903        * <pre>
1904        * The latest end time for a used vehicle, computed as the maximum over all
1905        * used vehicles of
1906        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
1907        * </pre>
1908        *
1909        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
1910        */
setLatestVehicleEndTime(com.google.protobuf.Timestamp value)1911       public Builder setLatestVehicleEndTime(com.google.protobuf.Timestamp value) {
1912         if (latestVehicleEndTimeBuilder_ == null) {
1913           if (value == null) {
1914             throw new NullPointerException();
1915           }
1916           latestVehicleEndTime_ = value;
1917         } else {
1918           latestVehicleEndTimeBuilder_.setMessage(value);
1919         }
1920         bitField0_ |= 0x00000010;
1921         onChanged();
1922         return this;
1923       }
1924       /**
1925        *
1926        *
1927        * <pre>
1928        * The latest end time for a used vehicle, computed as the maximum over all
1929        * used vehicles of
1930        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
1931        * </pre>
1932        *
1933        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
1934        */
setLatestVehicleEndTime( com.google.protobuf.Timestamp.Builder builderForValue)1935       public Builder setLatestVehicleEndTime(
1936           com.google.protobuf.Timestamp.Builder builderForValue) {
1937         if (latestVehicleEndTimeBuilder_ == null) {
1938           latestVehicleEndTime_ = builderForValue.build();
1939         } else {
1940           latestVehicleEndTimeBuilder_.setMessage(builderForValue.build());
1941         }
1942         bitField0_ |= 0x00000010;
1943         onChanged();
1944         return this;
1945       }
1946       /**
1947        *
1948        *
1949        * <pre>
1950        * The latest end time for a used vehicle, computed as the maximum over all
1951        * used vehicles of
1952        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
1953        * </pre>
1954        *
1955        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
1956        */
mergeLatestVehicleEndTime(com.google.protobuf.Timestamp value)1957       public Builder mergeLatestVehicleEndTime(com.google.protobuf.Timestamp value) {
1958         if (latestVehicleEndTimeBuilder_ == null) {
1959           if (((bitField0_ & 0x00000010) != 0)
1960               && latestVehicleEndTime_ != null
1961               && latestVehicleEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
1962             getLatestVehicleEndTimeBuilder().mergeFrom(value);
1963           } else {
1964             latestVehicleEndTime_ = value;
1965           }
1966         } else {
1967           latestVehicleEndTimeBuilder_.mergeFrom(value);
1968         }
1969         bitField0_ |= 0x00000010;
1970         onChanged();
1971         return this;
1972       }
1973       /**
1974        *
1975        *
1976        * <pre>
1977        * The latest end time for a used vehicle, computed as the maximum over all
1978        * used vehicles of
1979        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
1980        * </pre>
1981        *
1982        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
1983        */
clearLatestVehicleEndTime()1984       public Builder clearLatestVehicleEndTime() {
1985         bitField0_ = (bitField0_ & ~0x00000010);
1986         latestVehicleEndTime_ = null;
1987         if (latestVehicleEndTimeBuilder_ != null) {
1988           latestVehicleEndTimeBuilder_.dispose();
1989           latestVehicleEndTimeBuilder_ = null;
1990         }
1991         onChanged();
1992         return this;
1993       }
1994       /**
1995        *
1996        *
1997        * <pre>
1998        * The latest end time for a used vehicle, computed as the maximum over all
1999        * used vehicles of
2000        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
2001        * </pre>
2002        *
2003        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
2004        */
getLatestVehicleEndTimeBuilder()2005       public com.google.protobuf.Timestamp.Builder getLatestVehicleEndTimeBuilder() {
2006         bitField0_ |= 0x00000010;
2007         onChanged();
2008         return getLatestVehicleEndTimeFieldBuilder().getBuilder();
2009       }
2010       /**
2011        *
2012        *
2013        * <pre>
2014        * The latest end time for a used vehicle, computed as the maximum over all
2015        * used vehicles of
2016        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
2017        * </pre>
2018        *
2019        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
2020        */
getLatestVehicleEndTimeOrBuilder()2021       public com.google.protobuf.TimestampOrBuilder getLatestVehicleEndTimeOrBuilder() {
2022         if (latestVehicleEndTimeBuilder_ != null) {
2023           return latestVehicleEndTimeBuilder_.getMessageOrBuilder();
2024         } else {
2025           return latestVehicleEndTime_ == null
2026               ? com.google.protobuf.Timestamp.getDefaultInstance()
2027               : latestVehicleEndTime_;
2028         }
2029       }
2030       /**
2031        *
2032        *
2033        * <pre>
2034        * The latest end time for a used vehicle, computed as the maximum over all
2035        * used vehicles of
2036        * [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
2037        * </pre>
2038        *
2039        * <code>.google.protobuf.Timestamp latest_vehicle_end_time = 5;</code>
2040        */
2041       private com.google.protobuf.SingleFieldBuilderV3<
2042               com.google.protobuf.Timestamp,
2043               com.google.protobuf.Timestamp.Builder,
2044               com.google.protobuf.TimestampOrBuilder>
getLatestVehicleEndTimeFieldBuilder()2045           getLatestVehicleEndTimeFieldBuilder() {
2046         if (latestVehicleEndTimeBuilder_ == null) {
2047           latestVehicleEndTimeBuilder_ =
2048               new com.google.protobuf.SingleFieldBuilderV3<
2049                   com.google.protobuf.Timestamp,
2050                   com.google.protobuf.Timestamp.Builder,
2051                   com.google.protobuf.TimestampOrBuilder>(
2052                   getLatestVehicleEndTime(), getParentForChildren(), isClean());
2053           latestVehicleEndTime_ = null;
2054         }
2055         return latestVehicleEndTimeBuilder_;
2056       }
2057 
2058       private com.google.protobuf.MapField<java.lang.String, java.lang.Double> costs_;
2059 
internalGetCosts()2060       private com.google.protobuf.MapField<java.lang.String, java.lang.Double> internalGetCosts() {
2061         if (costs_ == null) {
2062           return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry);
2063         }
2064         return costs_;
2065       }
2066 
2067       private com.google.protobuf.MapField<java.lang.String, java.lang.Double>
internalGetMutableCosts()2068           internalGetMutableCosts() {
2069         if (costs_ == null) {
2070           costs_ = com.google.protobuf.MapField.newMapField(CostsDefaultEntryHolder.defaultEntry);
2071         }
2072         if (!costs_.isMutable()) {
2073           costs_ = costs_.copy();
2074         }
2075         bitField0_ |= 0x00000020;
2076         onChanged();
2077         return costs_;
2078       }
2079 
getCostsCount()2080       public int getCostsCount() {
2081         return internalGetCosts().getMap().size();
2082       }
2083       /**
2084        *
2085        *
2086        * <pre>
2087        * Cost of the solution, broken down by cost-related request fields.
2088        * The keys are proto paths, relative to the input OptimizeToursRequest,
2089        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2090        * generated by the corresponding cost field, aggregated over the whole
2091        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2092        * sum of all pickup costs over the solution. All costs defined in the model
2093        * are reported in detail here with the exception of costs related to
2094        * TransitionAttributes that are only reported in an aggregated way as of
2095        * 2022/01.
2096        * </pre>
2097        *
2098        * <code>map&lt;string, double&gt; costs = 10;</code>
2099        */
2100       @java.lang.Override
containsCosts(java.lang.String key)2101       public boolean containsCosts(java.lang.String key) {
2102         if (key == null) {
2103           throw new NullPointerException("map key");
2104         }
2105         return internalGetCosts().getMap().containsKey(key);
2106       }
2107       /** Use {@link #getCostsMap()} instead. */
2108       @java.lang.Override
2109       @java.lang.Deprecated
getCosts()2110       public java.util.Map<java.lang.String, java.lang.Double> getCosts() {
2111         return getCostsMap();
2112       }
2113       /**
2114        *
2115        *
2116        * <pre>
2117        * Cost of the solution, broken down by cost-related request fields.
2118        * The keys are proto paths, relative to the input OptimizeToursRequest,
2119        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2120        * generated by the corresponding cost field, aggregated over the whole
2121        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2122        * sum of all pickup costs over the solution. All costs defined in the model
2123        * are reported in detail here with the exception of costs related to
2124        * TransitionAttributes that are only reported in an aggregated way as of
2125        * 2022/01.
2126        * </pre>
2127        *
2128        * <code>map&lt;string, double&gt; costs = 10;</code>
2129        */
2130       @java.lang.Override
getCostsMap()2131       public java.util.Map<java.lang.String, java.lang.Double> getCostsMap() {
2132         return internalGetCosts().getMap();
2133       }
2134       /**
2135        *
2136        *
2137        * <pre>
2138        * Cost of the solution, broken down by cost-related request fields.
2139        * The keys are proto paths, relative to the input OptimizeToursRequest,
2140        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2141        * generated by the corresponding cost field, aggregated over the whole
2142        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2143        * sum of all pickup costs over the solution. All costs defined in the model
2144        * are reported in detail here with the exception of costs related to
2145        * TransitionAttributes that are only reported in an aggregated way as of
2146        * 2022/01.
2147        * </pre>
2148        *
2149        * <code>map&lt;string, double&gt; costs = 10;</code>
2150        */
2151       @java.lang.Override
getCostsOrDefault(java.lang.String key, double defaultValue)2152       public double getCostsOrDefault(java.lang.String key, double defaultValue) {
2153         if (key == null) {
2154           throw new NullPointerException("map key");
2155         }
2156         java.util.Map<java.lang.String, java.lang.Double> map = internalGetCosts().getMap();
2157         return map.containsKey(key) ? map.get(key) : defaultValue;
2158       }
2159       /**
2160        *
2161        *
2162        * <pre>
2163        * Cost of the solution, broken down by cost-related request fields.
2164        * The keys are proto paths, relative to the input OptimizeToursRequest,
2165        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2166        * generated by the corresponding cost field, aggregated over the whole
2167        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2168        * sum of all pickup costs over the solution. All costs defined in the model
2169        * are reported in detail here with the exception of costs related to
2170        * TransitionAttributes that are only reported in an aggregated way as of
2171        * 2022/01.
2172        * </pre>
2173        *
2174        * <code>map&lt;string, double&gt; costs = 10;</code>
2175        */
2176       @java.lang.Override
getCostsOrThrow(java.lang.String key)2177       public double getCostsOrThrow(java.lang.String key) {
2178         if (key == null) {
2179           throw new NullPointerException("map key");
2180         }
2181         java.util.Map<java.lang.String, java.lang.Double> map = internalGetCosts().getMap();
2182         if (!map.containsKey(key)) {
2183           throw new java.lang.IllegalArgumentException();
2184         }
2185         return map.get(key);
2186       }
2187 
clearCosts()2188       public Builder clearCosts() {
2189         bitField0_ = (bitField0_ & ~0x00000020);
2190         internalGetMutableCosts().getMutableMap().clear();
2191         return this;
2192       }
2193       /**
2194        *
2195        *
2196        * <pre>
2197        * Cost of the solution, broken down by cost-related request fields.
2198        * The keys are proto paths, relative to the input OptimizeToursRequest,
2199        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2200        * generated by the corresponding cost field, aggregated over the whole
2201        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2202        * sum of all pickup costs over the solution. All costs defined in the model
2203        * are reported in detail here with the exception of costs related to
2204        * TransitionAttributes that are only reported in an aggregated way as of
2205        * 2022/01.
2206        * </pre>
2207        *
2208        * <code>map&lt;string, double&gt; costs = 10;</code>
2209        */
removeCosts(java.lang.String key)2210       public Builder removeCosts(java.lang.String key) {
2211         if (key == null) {
2212           throw new NullPointerException("map key");
2213         }
2214         internalGetMutableCosts().getMutableMap().remove(key);
2215         return this;
2216       }
2217       /** Use alternate mutation accessors instead. */
2218       @java.lang.Deprecated
getMutableCosts()2219       public java.util.Map<java.lang.String, java.lang.Double> getMutableCosts() {
2220         bitField0_ |= 0x00000020;
2221         return internalGetMutableCosts().getMutableMap();
2222       }
2223       /**
2224        *
2225        *
2226        * <pre>
2227        * Cost of the solution, broken down by cost-related request fields.
2228        * The keys are proto paths, relative to the input OptimizeToursRequest,
2229        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2230        * generated by the corresponding cost field, aggregated over the whole
2231        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2232        * sum of all pickup costs over the solution. All costs defined in the model
2233        * are reported in detail here with the exception of costs related to
2234        * TransitionAttributes that are only reported in an aggregated way as of
2235        * 2022/01.
2236        * </pre>
2237        *
2238        * <code>map&lt;string, double&gt; costs = 10;</code>
2239        */
putCosts(java.lang.String key, double value)2240       public Builder putCosts(java.lang.String key, double value) {
2241         if (key == null) {
2242           throw new NullPointerException("map key");
2243         }
2244 
2245         internalGetMutableCosts().getMutableMap().put(key, value);
2246         bitField0_ |= 0x00000020;
2247         return this;
2248       }
2249       /**
2250        *
2251        *
2252        * <pre>
2253        * Cost of the solution, broken down by cost-related request fields.
2254        * The keys are proto paths, relative to the input OptimizeToursRequest,
2255        * e.g. "model.shipments.pickups.cost", and the values are the total cost
2256        * generated by the corresponding cost field, aggregated over the whole
2257        * solution. In other words, costs["model.shipments.pickups.cost"] is the
2258        * sum of all pickup costs over the solution. All costs defined in the model
2259        * are reported in detail here with the exception of costs related to
2260        * TransitionAttributes that are only reported in an aggregated way as of
2261        * 2022/01.
2262        * </pre>
2263        *
2264        * <code>map&lt;string, double&gt; costs = 10;</code>
2265        */
putAllCosts(java.util.Map<java.lang.String, java.lang.Double> values)2266       public Builder putAllCosts(java.util.Map<java.lang.String, java.lang.Double> values) {
2267         internalGetMutableCosts().getMutableMap().putAll(values);
2268         bitField0_ |= 0x00000020;
2269         return this;
2270       }
2271 
2272       private double totalCost_;
2273       /**
2274        *
2275        *
2276        * <pre>
2277        * Total cost of the solution. The sum of all values in the costs map.
2278        * </pre>
2279        *
2280        * <code>double total_cost = 6;</code>
2281        *
2282        * @return The totalCost.
2283        */
2284       @java.lang.Override
getTotalCost()2285       public double getTotalCost() {
2286         return totalCost_;
2287       }
2288       /**
2289        *
2290        *
2291        * <pre>
2292        * Total cost of the solution. The sum of all values in the costs map.
2293        * </pre>
2294        *
2295        * <code>double total_cost = 6;</code>
2296        *
2297        * @param value The totalCost to set.
2298        * @return This builder for chaining.
2299        */
setTotalCost(double value)2300       public Builder setTotalCost(double value) {
2301 
2302         totalCost_ = value;
2303         bitField0_ |= 0x00000040;
2304         onChanged();
2305         return this;
2306       }
2307       /**
2308        *
2309        *
2310        * <pre>
2311        * Total cost of the solution. The sum of all values in the costs map.
2312        * </pre>
2313        *
2314        * <code>double total_cost = 6;</code>
2315        *
2316        * @return This builder for chaining.
2317        */
clearTotalCost()2318       public Builder clearTotalCost() {
2319         bitField0_ = (bitField0_ & ~0x00000040);
2320         totalCost_ = 0D;
2321         onChanged();
2322         return this;
2323       }
2324 
2325       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2326       public final Builder setUnknownFields(
2327           final com.google.protobuf.UnknownFieldSet unknownFields) {
2328         return super.setUnknownFields(unknownFields);
2329       }
2330 
2331       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2332       public final Builder mergeUnknownFields(
2333           final com.google.protobuf.UnknownFieldSet unknownFields) {
2334         return super.mergeUnknownFields(unknownFields);
2335       }
2336 
2337       // @@protoc_insertion_point(builder_scope:google.cloud.optimization.v1.OptimizeToursResponse.Metrics)
2338     }
2339 
2340     // @@protoc_insertion_point(class_scope:google.cloud.optimization.v1.OptimizeToursResponse.Metrics)
2341     private static final com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics
2342         DEFAULT_INSTANCE;
2343 
2344     static {
2345       DEFAULT_INSTANCE = new com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics();
2346     }
2347 
2348     public static com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics
getDefaultInstance()2349         getDefaultInstance() {
2350       return DEFAULT_INSTANCE;
2351     }
2352 
2353     private static final com.google.protobuf.Parser<Metrics> PARSER =
2354         new com.google.protobuf.AbstractParser<Metrics>() {
2355           @java.lang.Override
2356           public Metrics parsePartialFrom(
2357               com.google.protobuf.CodedInputStream input,
2358               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2359               throws com.google.protobuf.InvalidProtocolBufferException {
2360             Builder builder = newBuilder();
2361             try {
2362               builder.mergeFrom(input, extensionRegistry);
2363             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2364               throw e.setUnfinishedMessage(builder.buildPartial());
2365             } catch (com.google.protobuf.UninitializedMessageException e) {
2366               throw e.asInvalidProtocolBufferException()
2367                   .setUnfinishedMessage(builder.buildPartial());
2368             } catch (java.io.IOException e) {
2369               throw new com.google.protobuf.InvalidProtocolBufferException(e)
2370                   .setUnfinishedMessage(builder.buildPartial());
2371             }
2372             return builder.buildPartial();
2373           }
2374         };
2375 
parser()2376     public static com.google.protobuf.Parser<Metrics> parser() {
2377       return PARSER;
2378     }
2379 
2380     @java.lang.Override
getParserForType()2381     public com.google.protobuf.Parser<Metrics> getParserForType() {
2382       return PARSER;
2383     }
2384 
2385     @java.lang.Override
2386     public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics
getDefaultInstanceForType()2387         getDefaultInstanceForType() {
2388       return DEFAULT_INSTANCE;
2389     }
2390   }
2391 
2392   public static final int ROUTES_FIELD_NUMBER = 1;
2393 
2394   @SuppressWarnings("serial")
2395   private java.util.List<com.google.cloud.optimization.v1.ShipmentRoute> routes_;
2396   /**
2397    *
2398    *
2399    * <pre>
2400    * Routes computed for each vehicle; the i-th route corresponds to the i-th
2401    * vehicle in the model.
2402    * </pre>
2403    *
2404    * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
2405    */
2406   @java.lang.Override
getRoutesList()2407   public java.util.List<com.google.cloud.optimization.v1.ShipmentRoute> getRoutesList() {
2408     return routes_;
2409   }
2410   /**
2411    *
2412    *
2413    * <pre>
2414    * Routes computed for each vehicle; the i-th route corresponds to the i-th
2415    * vehicle in the model.
2416    * </pre>
2417    *
2418    * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
2419    */
2420   @java.lang.Override
2421   public java.util.List<? extends com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>
getRoutesOrBuilderList()2422       getRoutesOrBuilderList() {
2423     return routes_;
2424   }
2425   /**
2426    *
2427    *
2428    * <pre>
2429    * Routes computed for each vehicle; the i-th route corresponds to the i-th
2430    * vehicle in the model.
2431    * </pre>
2432    *
2433    * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
2434    */
2435   @java.lang.Override
getRoutesCount()2436   public int getRoutesCount() {
2437     return routes_.size();
2438   }
2439   /**
2440    *
2441    *
2442    * <pre>
2443    * Routes computed for each vehicle; the i-th route corresponds to the i-th
2444    * vehicle in the model.
2445    * </pre>
2446    *
2447    * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
2448    */
2449   @java.lang.Override
getRoutes(int index)2450   public com.google.cloud.optimization.v1.ShipmentRoute getRoutes(int index) {
2451     return routes_.get(index);
2452   }
2453   /**
2454    *
2455    *
2456    * <pre>
2457    * Routes computed for each vehicle; the i-th route corresponds to the i-th
2458    * vehicle in the model.
2459    * </pre>
2460    *
2461    * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
2462    */
2463   @java.lang.Override
getRoutesOrBuilder(int index)2464   public com.google.cloud.optimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder(int index) {
2465     return routes_.get(index);
2466   }
2467 
2468   public static final int REQUEST_LABEL_FIELD_NUMBER = 3;
2469 
2470   @SuppressWarnings("serial")
2471   private volatile java.lang.Object requestLabel_ = "";
2472   /**
2473    *
2474    *
2475    * <pre>
2476    * Copy of the
2477    * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
2478    * if a label was specified in the request.
2479    * </pre>
2480    *
2481    * <code>string request_label = 3;</code>
2482    *
2483    * @return The requestLabel.
2484    */
2485   @java.lang.Override
getRequestLabel()2486   public java.lang.String getRequestLabel() {
2487     java.lang.Object ref = requestLabel_;
2488     if (ref instanceof java.lang.String) {
2489       return (java.lang.String) ref;
2490     } else {
2491       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2492       java.lang.String s = bs.toStringUtf8();
2493       requestLabel_ = s;
2494       return s;
2495     }
2496   }
2497   /**
2498    *
2499    *
2500    * <pre>
2501    * Copy of the
2502    * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
2503    * if a label was specified in the request.
2504    * </pre>
2505    *
2506    * <code>string request_label = 3;</code>
2507    *
2508    * @return The bytes for requestLabel.
2509    */
2510   @java.lang.Override
getRequestLabelBytes()2511   public com.google.protobuf.ByteString getRequestLabelBytes() {
2512     java.lang.Object ref = requestLabel_;
2513     if (ref instanceof java.lang.String) {
2514       com.google.protobuf.ByteString b =
2515           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2516       requestLabel_ = b;
2517       return b;
2518     } else {
2519       return (com.google.protobuf.ByteString) ref;
2520     }
2521   }
2522 
2523   public static final int SKIPPED_SHIPMENTS_FIELD_NUMBER = 4;
2524 
2525   @SuppressWarnings("serial")
2526   private java.util.List<com.google.cloud.optimization.v1.SkippedShipment> skippedShipments_;
2527   /**
2528    *
2529    *
2530    * <pre>
2531    * The list of all shipments skipped.
2532    * </pre>
2533    *
2534    * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
2535    */
2536   @java.lang.Override
2537   public java.util.List<com.google.cloud.optimization.v1.SkippedShipment>
getSkippedShipmentsList()2538       getSkippedShipmentsList() {
2539     return skippedShipments_;
2540   }
2541   /**
2542    *
2543    *
2544    * <pre>
2545    * The list of all shipments skipped.
2546    * </pre>
2547    *
2548    * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
2549    */
2550   @java.lang.Override
2551   public java.util.List<? extends com.google.cloud.optimization.v1.SkippedShipmentOrBuilder>
getSkippedShipmentsOrBuilderList()2552       getSkippedShipmentsOrBuilderList() {
2553     return skippedShipments_;
2554   }
2555   /**
2556    *
2557    *
2558    * <pre>
2559    * The list of all shipments skipped.
2560    * </pre>
2561    *
2562    * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
2563    */
2564   @java.lang.Override
getSkippedShipmentsCount()2565   public int getSkippedShipmentsCount() {
2566     return skippedShipments_.size();
2567   }
2568   /**
2569    *
2570    *
2571    * <pre>
2572    * The list of all shipments skipped.
2573    * </pre>
2574    *
2575    * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
2576    */
2577   @java.lang.Override
getSkippedShipments(int index)2578   public com.google.cloud.optimization.v1.SkippedShipment getSkippedShipments(int index) {
2579     return skippedShipments_.get(index);
2580   }
2581   /**
2582    *
2583    *
2584    * <pre>
2585    * The list of all shipments skipped.
2586    * </pre>
2587    *
2588    * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
2589    */
2590   @java.lang.Override
getSkippedShipmentsOrBuilder( int index)2591   public com.google.cloud.optimization.v1.SkippedShipmentOrBuilder getSkippedShipmentsOrBuilder(
2592       int index) {
2593     return skippedShipments_.get(index);
2594   }
2595 
2596   public static final int VALIDATION_ERRORS_FIELD_NUMBER = 5;
2597 
2598   @SuppressWarnings("serial")
2599   private java.util.List<com.google.cloud.optimization.v1.OptimizeToursValidationError>
2600       validationErrors_;
2601   /**
2602    *
2603    *
2604    * <pre>
2605    * List of all the validation errors that we were able to detect
2606    * independently. See the "MULTIPLE ERRORS" explanation for the
2607    * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
2608    * message.
2609    * </pre>
2610    *
2611    * <code>
2612    * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
2613    * </code>
2614    */
2615   @java.lang.Override
2616   public java.util.List<com.google.cloud.optimization.v1.OptimizeToursValidationError>
getValidationErrorsList()2617       getValidationErrorsList() {
2618     return validationErrors_;
2619   }
2620   /**
2621    *
2622    *
2623    * <pre>
2624    * List of all the validation errors that we were able to detect
2625    * independently. See the "MULTIPLE ERRORS" explanation for the
2626    * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
2627    * message.
2628    * </pre>
2629    *
2630    * <code>
2631    * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
2632    * </code>
2633    */
2634   @java.lang.Override
2635   public java.util.List<
2636           ? extends com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder>
getValidationErrorsOrBuilderList()2637       getValidationErrorsOrBuilderList() {
2638     return validationErrors_;
2639   }
2640   /**
2641    *
2642    *
2643    * <pre>
2644    * List of all the validation errors that we were able to detect
2645    * independently. See the "MULTIPLE ERRORS" explanation for the
2646    * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
2647    * message.
2648    * </pre>
2649    *
2650    * <code>
2651    * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
2652    * </code>
2653    */
2654   @java.lang.Override
getValidationErrorsCount()2655   public int getValidationErrorsCount() {
2656     return validationErrors_.size();
2657   }
2658   /**
2659    *
2660    *
2661    * <pre>
2662    * List of all the validation errors that we were able to detect
2663    * independently. See the "MULTIPLE ERRORS" explanation for the
2664    * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
2665    * message.
2666    * </pre>
2667    *
2668    * <code>
2669    * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
2670    * </code>
2671    */
2672   @java.lang.Override
getValidationErrors( int index)2673   public com.google.cloud.optimization.v1.OptimizeToursValidationError getValidationErrors(
2674       int index) {
2675     return validationErrors_.get(index);
2676   }
2677   /**
2678    *
2679    *
2680    * <pre>
2681    * List of all the validation errors that we were able to detect
2682    * independently. See the "MULTIPLE ERRORS" explanation for the
2683    * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
2684    * message.
2685    * </pre>
2686    *
2687    * <code>
2688    * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
2689    * </code>
2690    */
2691   @java.lang.Override
2692   public com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder
getValidationErrorsOrBuilder(int index)2693       getValidationErrorsOrBuilder(int index) {
2694     return validationErrors_.get(index);
2695   }
2696 
2697   public static final int METRICS_FIELD_NUMBER = 6;
2698   private com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics_;
2699   /**
2700    *
2701    *
2702    * <pre>
2703    * Duration, distance and usage metrics for this solution.
2704    * </pre>
2705    *
2706    * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
2707    *
2708    * @return Whether the metrics field is set.
2709    */
2710   @java.lang.Override
hasMetrics()2711   public boolean hasMetrics() {
2712     return metrics_ != null;
2713   }
2714   /**
2715    *
2716    *
2717    * <pre>
2718    * Duration, distance and usage metrics for this solution.
2719    * </pre>
2720    *
2721    * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
2722    *
2723    * @return The metrics.
2724    */
2725   @java.lang.Override
getMetrics()2726   public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics getMetrics() {
2727     return metrics_ == null
2728         ? com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance()
2729         : metrics_;
2730   }
2731   /**
2732    *
2733    *
2734    * <pre>
2735    * Duration, distance and usage metrics for this solution.
2736    * </pre>
2737    *
2738    * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
2739    */
2740   @java.lang.Override
2741   public com.google.cloud.optimization.v1.OptimizeToursResponse.MetricsOrBuilder
getMetricsOrBuilder()2742       getMetricsOrBuilder() {
2743     return metrics_ == null
2744         ? com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance()
2745         : metrics_;
2746   }
2747 
2748   public static final int TOTAL_COST_FIELD_NUMBER = 2;
2749   private double totalCost_ = 0D;
2750   /**
2751    *
2752    *
2753    * <pre>
2754    * Deprecated: Use
2755    * [Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
2756    * instead. Total cost of the solution. This takes into account all costs:
2757    * costs per per hour and travel hour, fixed vehicle costs, unperformed
2758    * shipment penalty costs, global duration cost, etc.
2759    * </pre>
2760    *
2761    * <code>double total_cost = 2 [deprecated = true];</code>
2762    *
2763    * @deprecated google.cloud.optimization.v1.OptimizeToursResponse.total_cost is deprecated. See
2764    *     google/cloud/optimization/v1/fleet_routing.proto;l=425
2765    * @return The totalCost.
2766    */
2767   @java.lang.Override
2768   @java.lang.Deprecated
getTotalCost()2769   public double getTotalCost() {
2770     return totalCost_;
2771   }
2772 
2773   private byte memoizedIsInitialized = -1;
2774 
2775   @java.lang.Override
isInitialized()2776   public final boolean isInitialized() {
2777     byte isInitialized = memoizedIsInitialized;
2778     if (isInitialized == 1) return true;
2779     if (isInitialized == 0) return false;
2780 
2781     memoizedIsInitialized = 1;
2782     return true;
2783   }
2784 
2785   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)2786   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
2787     for (int i = 0; i < routes_.size(); i++) {
2788       output.writeMessage(1, routes_.get(i));
2789     }
2790     if (java.lang.Double.doubleToRawLongBits(totalCost_) != 0) {
2791       output.writeDouble(2, totalCost_);
2792     }
2793     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestLabel_)) {
2794       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestLabel_);
2795     }
2796     for (int i = 0; i < skippedShipments_.size(); i++) {
2797       output.writeMessage(4, skippedShipments_.get(i));
2798     }
2799     for (int i = 0; i < validationErrors_.size(); i++) {
2800       output.writeMessage(5, validationErrors_.get(i));
2801     }
2802     if (metrics_ != null) {
2803       output.writeMessage(6, getMetrics());
2804     }
2805     getUnknownFields().writeTo(output);
2806   }
2807 
2808   @java.lang.Override
getSerializedSize()2809   public int getSerializedSize() {
2810     int size = memoizedSize;
2811     if (size != -1) return size;
2812 
2813     size = 0;
2814     for (int i = 0; i < routes_.size(); i++) {
2815       size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, routes_.get(i));
2816     }
2817     if (java.lang.Double.doubleToRawLongBits(totalCost_) != 0) {
2818       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, totalCost_);
2819     }
2820     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestLabel_)) {
2821       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestLabel_);
2822     }
2823     for (int i = 0; i < skippedShipments_.size(); i++) {
2824       size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, skippedShipments_.get(i));
2825     }
2826     for (int i = 0; i < validationErrors_.size(); i++) {
2827       size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, validationErrors_.get(i));
2828     }
2829     if (metrics_ != null) {
2830       size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMetrics());
2831     }
2832     size += getUnknownFields().getSerializedSize();
2833     memoizedSize = size;
2834     return size;
2835   }
2836 
2837   @java.lang.Override
equals(final java.lang.Object obj)2838   public boolean equals(final java.lang.Object obj) {
2839     if (obj == this) {
2840       return true;
2841     }
2842     if (!(obj instanceof com.google.cloud.optimization.v1.OptimizeToursResponse)) {
2843       return super.equals(obj);
2844     }
2845     com.google.cloud.optimization.v1.OptimizeToursResponse other =
2846         (com.google.cloud.optimization.v1.OptimizeToursResponse) obj;
2847 
2848     if (!getRoutesList().equals(other.getRoutesList())) return false;
2849     if (!getRequestLabel().equals(other.getRequestLabel())) return false;
2850     if (!getSkippedShipmentsList().equals(other.getSkippedShipmentsList())) return false;
2851     if (!getValidationErrorsList().equals(other.getValidationErrorsList())) return false;
2852     if (hasMetrics() != other.hasMetrics()) return false;
2853     if (hasMetrics()) {
2854       if (!getMetrics().equals(other.getMetrics())) return false;
2855     }
2856     if (java.lang.Double.doubleToLongBits(getTotalCost())
2857         != java.lang.Double.doubleToLongBits(other.getTotalCost())) return false;
2858     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
2859     return true;
2860   }
2861 
2862   @java.lang.Override
hashCode()2863   public int hashCode() {
2864     if (memoizedHashCode != 0) {
2865       return memoizedHashCode;
2866     }
2867     int hash = 41;
2868     hash = (19 * hash) + getDescriptor().hashCode();
2869     if (getRoutesCount() > 0) {
2870       hash = (37 * hash) + ROUTES_FIELD_NUMBER;
2871       hash = (53 * hash) + getRoutesList().hashCode();
2872     }
2873     hash = (37 * hash) + REQUEST_LABEL_FIELD_NUMBER;
2874     hash = (53 * hash) + getRequestLabel().hashCode();
2875     if (getSkippedShipmentsCount() > 0) {
2876       hash = (37 * hash) + SKIPPED_SHIPMENTS_FIELD_NUMBER;
2877       hash = (53 * hash) + getSkippedShipmentsList().hashCode();
2878     }
2879     if (getValidationErrorsCount() > 0) {
2880       hash = (37 * hash) + VALIDATION_ERRORS_FIELD_NUMBER;
2881       hash = (53 * hash) + getValidationErrorsList().hashCode();
2882     }
2883     if (hasMetrics()) {
2884       hash = (37 * hash) + METRICS_FIELD_NUMBER;
2885       hash = (53 * hash) + getMetrics().hashCode();
2886     }
2887     hash = (37 * hash) + TOTAL_COST_FIELD_NUMBER;
2888     hash =
2889         (53 * hash)
2890             + com.google.protobuf.Internal.hashLong(
2891                 java.lang.Double.doubleToLongBits(getTotalCost()));
2892     hash = (29 * hash) + getUnknownFields().hashCode();
2893     memoizedHashCode = hash;
2894     return hash;
2895   }
2896 
parseFrom( java.nio.ByteBuffer data)2897   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2898       java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
2899     return PARSER.parseFrom(data);
2900   }
2901 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2902   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2903       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2904       throws com.google.protobuf.InvalidProtocolBufferException {
2905     return PARSER.parseFrom(data, extensionRegistry);
2906   }
2907 
parseFrom( com.google.protobuf.ByteString data)2908   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2909       com.google.protobuf.ByteString data)
2910       throws com.google.protobuf.InvalidProtocolBufferException {
2911     return PARSER.parseFrom(data);
2912   }
2913 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2914   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2915       com.google.protobuf.ByteString data,
2916       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2917       throws com.google.protobuf.InvalidProtocolBufferException {
2918     return PARSER.parseFrom(data, extensionRegistry);
2919   }
2920 
parseFrom(byte[] data)2921   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(byte[] data)
2922       throws com.google.protobuf.InvalidProtocolBufferException {
2923     return PARSER.parseFrom(data);
2924   }
2925 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2926   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2927       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2928       throws com.google.protobuf.InvalidProtocolBufferException {
2929     return PARSER.parseFrom(data, extensionRegistry);
2930   }
2931 
parseFrom( java.io.InputStream input)2932   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2933       java.io.InputStream input) throws java.io.IOException {
2934     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2935   }
2936 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2937   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2938       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2939       throws java.io.IOException {
2940     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2941         PARSER, input, extensionRegistry);
2942   }
2943 
parseDelimitedFrom( java.io.InputStream input)2944   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseDelimitedFrom(
2945       java.io.InputStream input) throws java.io.IOException {
2946     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
2947   }
2948 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2949   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseDelimitedFrom(
2950       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2951       throws java.io.IOException {
2952     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
2953         PARSER, input, extensionRegistry);
2954   }
2955 
parseFrom( com.google.protobuf.CodedInputStream input)2956   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2957       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
2958     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2959   }
2960 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2961   public static com.google.cloud.optimization.v1.OptimizeToursResponse parseFrom(
2962       com.google.protobuf.CodedInputStream input,
2963       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2964       throws java.io.IOException {
2965     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2966         PARSER, input, extensionRegistry);
2967   }
2968 
2969   @java.lang.Override
newBuilderForType()2970   public Builder newBuilderForType() {
2971     return newBuilder();
2972   }
2973 
newBuilder()2974   public static Builder newBuilder() {
2975     return DEFAULT_INSTANCE.toBuilder();
2976   }
2977 
newBuilder( com.google.cloud.optimization.v1.OptimizeToursResponse prototype)2978   public static Builder newBuilder(
2979       com.google.cloud.optimization.v1.OptimizeToursResponse prototype) {
2980     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
2981   }
2982 
2983   @java.lang.Override
toBuilder()2984   public Builder toBuilder() {
2985     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
2986   }
2987 
2988   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2989   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2990     Builder builder = new Builder(parent);
2991     return builder;
2992   }
2993   /**
2994    *
2995    *
2996    * <pre>
2997    * Response after solving a tour optimization problem containing the routes
2998    * followed by each vehicle, the shipments which have been skipped and the
2999    * overall cost of the solution.
3000    * </pre>
3001    *
3002    * Protobuf type {@code google.cloud.optimization.v1.OptimizeToursResponse}
3003    */
3004   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
3005       implements
3006       // @@protoc_insertion_point(builder_implements:google.cloud.optimization.v1.OptimizeToursResponse)
3007       com.google.cloud.optimization.v1.OptimizeToursResponseOrBuilder {
getDescriptor()3008     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
3009       return com.google.cloud.optimization.v1.FleetRoutingProto
3010           .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_descriptor;
3011     }
3012 
3013     @java.lang.Override
3014     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()3015         internalGetFieldAccessorTable() {
3016       return com.google.cloud.optimization.v1.FleetRoutingProto
3017           .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_fieldAccessorTable
3018           .ensureFieldAccessorsInitialized(
3019               com.google.cloud.optimization.v1.OptimizeToursResponse.class,
3020               com.google.cloud.optimization.v1.OptimizeToursResponse.Builder.class);
3021     }
3022 
3023     // Construct using com.google.cloud.optimization.v1.OptimizeToursResponse.newBuilder()
Builder()3024     private Builder() {}
3025 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)3026     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
3027       super(parent);
3028     }
3029 
3030     @java.lang.Override
clear()3031     public Builder clear() {
3032       super.clear();
3033       bitField0_ = 0;
3034       if (routesBuilder_ == null) {
3035         routes_ = java.util.Collections.emptyList();
3036       } else {
3037         routes_ = null;
3038         routesBuilder_.clear();
3039       }
3040       bitField0_ = (bitField0_ & ~0x00000001);
3041       requestLabel_ = "";
3042       if (skippedShipmentsBuilder_ == null) {
3043         skippedShipments_ = java.util.Collections.emptyList();
3044       } else {
3045         skippedShipments_ = null;
3046         skippedShipmentsBuilder_.clear();
3047       }
3048       bitField0_ = (bitField0_ & ~0x00000004);
3049       if (validationErrorsBuilder_ == null) {
3050         validationErrors_ = java.util.Collections.emptyList();
3051       } else {
3052         validationErrors_ = null;
3053         validationErrorsBuilder_.clear();
3054       }
3055       bitField0_ = (bitField0_ & ~0x00000008);
3056       metrics_ = null;
3057       if (metricsBuilder_ != null) {
3058         metricsBuilder_.dispose();
3059         metricsBuilder_ = null;
3060       }
3061       totalCost_ = 0D;
3062       return this;
3063     }
3064 
3065     @java.lang.Override
getDescriptorForType()3066     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
3067       return com.google.cloud.optimization.v1.FleetRoutingProto
3068           .internal_static_google_cloud_optimization_v1_OptimizeToursResponse_descriptor;
3069     }
3070 
3071     @java.lang.Override
getDefaultInstanceForType()3072     public com.google.cloud.optimization.v1.OptimizeToursResponse getDefaultInstanceForType() {
3073       return com.google.cloud.optimization.v1.OptimizeToursResponse.getDefaultInstance();
3074     }
3075 
3076     @java.lang.Override
build()3077     public com.google.cloud.optimization.v1.OptimizeToursResponse build() {
3078       com.google.cloud.optimization.v1.OptimizeToursResponse result = buildPartial();
3079       if (!result.isInitialized()) {
3080         throw newUninitializedMessageException(result);
3081       }
3082       return result;
3083     }
3084 
3085     @java.lang.Override
buildPartial()3086     public com.google.cloud.optimization.v1.OptimizeToursResponse buildPartial() {
3087       com.google.cloud.optimization.v1.OptimizeToursResponse result =
3088           new com.google.cloud.optimization.v1.OptimizeToursResponse(this);
3089       buildPartialRepeatedFields(result);
3090       if (bitField0_ != 0) {
3091         buildPartial0(result);
3092       }
3093       onBuilt();
3094       return result;
3095     }
3096 
buildPartialRepeatedFields( com.google.cloud.optimization.v1.OptimizeToursResponse result)3097     private void buildPartialRepeatedFields(
3098         com.google.cloud.optimization.v1.OptimizeToursResponse result) {
3099       if (routesBuilder_ == null) {
3100         if (((bitField0_ & 0x00000001) != 0)) {
3101           routes_ = java.util.Collections.unmodifiableList(routes_);
3102           bitField0_ = (bitField0_ & ~0x00000001);
3103         }
3104         result.routes_ = routes_;
3105       } else {
3106         result.routes_ = routesBuilder_.build();
3107       }
3108       if (skippedShipmentsBuilder_ == null) {
3109         if (((bitField0_ & 0x00000004) != 0)) {
3110           skippedShipments_ = java.util.Collections.unmodifiableList(skippedShipments_);
3111           bitField0_ = (bitField0_ & ~0x00000004);
3112         }
3113         result.skippedShipments_ = skippedShipments_;
3114       } else {
3115         result.skippedShipments_ = skippedShipmentsBuilder_.build();
3116       }
3117       if (validationErrorsBuilder_ == null) {
3118         if (((bitField0_ & 0x00000008) != 0)) {
3119           validationErrors_ = java.util.Collections.unmodifiableList(validationErrors_);
3120           bitField0_ = (bitField0_ & ~0x00000008);
3121         }
3122         result.validationErrors_ = validationErrors_;
3123       } else {
3124         result.validationErrors_ = validationErrorsBuilder_.build();
3125       }
3126     }
3127 
buildPartial0(com.google.cloud.optimization.v1.OptimizeToursResponse result)3128     private void buildPartial0(com.google.cloud.optimization.v1.OptimizeToursResponse result) {
3129       int from_bitField0_ = bitField0_;
3130       if (((from_bitField0_ & 0x00000002) != 0)) {
3131         result.requestLabel_ = requestLabel_;
3132       }
3133       if (((from_bitField0_ & 0x00000010) != 0)) {
3134         result.metrics_ = metricsBuilder_ == null ? metrics_ : metricsBuilder_.build();
3135       }
3136       if (((from_bitField0_ & 0x00000020) != 0)) {
3137         result.totalCost_ = totalCost_;
3138       }
3139     }
3140 
3141     @java.lang.Override
clone()3142     public Builder clone() {
3143       return super.clone();
3144     }
3145 
3146     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)3147     public Builder setField(
3148         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
3149       return super.setField(field, value);
3150     }
3151 
3152     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)3153     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
3154       return super.clearField(field);
3155     }
3156 
3157     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)3158     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
3159       return super.clearOneof(oneof);
3160     }
3161 
3162     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)3163     public Builder setRepeatedField(
3164         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
3165       return super.setRepeatedField(field, index, value);
3166     }
3167 
3168     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)3169     public Builder addRepeatedField(
3170         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
3171       return super.addRepeatedField(field, value);
3172     }
3173 
3174     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)3175     public Builder mergeFrom(com.google.protobuf.Message other) {
3176       if (other instanceof com.google.cloud.optimization.v1.OptimizeToursResponse) {
3177         return mergeFrom((com.google.cloud.optimization.v1.OptimizeToursResponse) other);
3178       } else {
3179         super.mergeFrom(other);
3180         return this;
3181       }
3182     }
3183 
mergeFrom(com.google.cloud.optimization.v1.OptimizeToursResponse other)3184     public Builder mergeFrom(com.google.cloud.optimization.v1.OptimizeToursResponse other) {
3185       if (other == com.google.cloud.optimization.v1.OptimizeToursResponse.getDefaultInstance())
3186         return this;
3187       if (routesBuilder_ == null) {
3188         if (!other.routes_.isEmpty()) {
3189           if (routes_.isEmpty()) {
3190             routes_ = other.routes_;
3191             bitField0_ = (bitField0_ & ~0x00000001);
3192           } else {
3193             ensureRoutesIsMutable();
3194             routes_.addAll(other.routes_);
3195           }
3196           onChanged();
3197         }
3198       } else {
3199         if (!other.routes_.isEmpty()) {
3200           if (routesBuilder_.isEmpty()) {
3201             routesBuilder_.dispose();
3202             routesBuilder_ = null;
3203             routes_ = other.routes_;
3204             bitField0_ = (bitField0_ & ~0x00000001);
3205             routesBuilder_ =
3206                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
3207                     ? getRoutesFieldBuilder()
3208                     : null;
3209           } else {
3210             routesBuilder_.addAllMessages(other.routes_);
3211           }
3212         }
3213       }
3214       if (!other.getRequestLabel().isEmpty()) {
3215         requestLabel_ = other.requestLabel_;
3216         bitField0_ |= 0x00000002;
3217         onChanged();
3218       }
3219       if (skippedShipmentsBuilder_ == null) {
3220         if (!other.skippedShipments_.isEmpty()) {
3221           if (skippedShipments_.isEmpty()) {
3222             skippedShipments_ = other.skippedShipments_;
3223             bitField0_ = (bitField0_ & ~0x00000004);
3224           } else {
3225             ensureSkippedShipmentsIsMutable();
3226             skippedShipments_.addAll(other.skippedShipments_);
3227           }
3228           onChanged();
3229         }
3230       } else {
3231         if (!other.skippedShipments_.isEmpty()) {
3232           if (skippedShipmentsBuilder_.isEmpty()) {
3233             skippedShipmentsBuilder_.dispose();
3234             skippedShipmentsBuilder_ = null;
3235             skippedShipments_ = other.skippedShipments_;
3236             bitField0_ = (bitField0_ & ~0x00000004);
3237             skippedShipmentsBuilder_ =
3238                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
3239                     ? getSkippedShipmentsFieldBuilder()
3240                     : null;
3241           } else {
3242             skippedShipmentsBuilder_.addAllMessages(other.skippedShipments_);
3243           }
3244         }
3245       }
3246       if (validationErrorsBuilder_ == null) {
3247         if (!other.validationErrors_.isEmpty()) {
3248           if (validationErrors_.isEmpty()) {
3249             validationErrors_ = other.validationErrors_;
3250             bitField0_ = (bitField0_ & ~0x00000008);
3251           } else {
3252             ensureValidationErrorsIsMutable();
3253             validationErrors_.addAll(other.validationErrors_);
3254           }
3255           onChanged();
3256         }
3257       } else {
3258         if (!other.validationErrors_.isEmpty()) {
3259           if (validationErrorsBuilder_.isEmpty()) {
3260             validationErrorsBuilder_.dispose();
3261             validationErrorsBuilder_ = null;
3262             validationErrors_ = other.validationErrors_;
3263             bitField0_ = (bitField0_ & ~0x00000008);
3264             validationErrorsBuilder_ =
3265                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
3266                     ? getValidationErrorsFieldBuilder()
3267                     : null;
3268           } else {
3269             validationErrorsBuilder_.addAllMessages(other.validationErrors_);
3270           }
3271         }
3272       }
3273       if (other.hasMetrics()) {
3274         mergeMetrics(other.getMetrics());
3275       }
3276       if (other.getTotalCost() != 0D) {
3277         setTotalCost(other.getTotalCost());
3278       }
3279       this.mergeUnknownFields(other.getUnknownFields());
3280       onChanged();
3281       return this;
3282     }
3283 
3284     @java.lang.Override
isInitialized()3285     public final boolean isInitialized() {
3286       return true;
3287     }
3288 
3289     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3290     public Builder mergeFrom(
3291         com.google.protobuf.CodedInputStream input,
3292         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3293         throws java.io.IOException {
3294       if (extensionRegistry == null) {
3295         throw new java.lang.NullPointerException();
3296       }
3297       try {
3298         boolean done = false;
3299         while (!done) {
3300           int tag = input.readTag();
3301           switch (tag) {
3302             case 0:
3303               done = true;
3304               break;
3305             case 10:
3306               {
3307                 com.google.cloud.optimization.v1.ShipmentRoute m =
3308                     input.readMessage(
3309                         com.google.cloud.optimization.v1.ShipmentRoute.parser(), extensionRegistry);
3310                 if (routesBuilder_ == null) {
3311                   ensureRoutesIsMutable();
3312                   routes_.add(m);
3313                 } else {
3314                   routesBuilder_.addMessage(m);
3315                 }
3316                 break;
3317               } // case 10
3318             case 17:
3319               {
3320                 totalCost_ = input.readDouble();
3321                 bitField0_ |= 0x00000020;
3322                 break;
3323               } // case 17
3324             case 26:
3325               {
3326                 requestLabel_ = input.readStringRequireUtf8();
3327                 bitField0_ |= 0x00000002;
3328                 break;
3329               } // case 26
3330             case 34:
3331               {
3332                 com.google.cloud.optimization.v1.SkippedShipment m =
3333                     input.readMessage(
3334                         com.google.cloud.optimization.v1.SkippedShipment.parser(),
3335                         extensionRegistry);
3336                 if (skippedShipmentsBuilder_ == null) {
3337                   ensureSkippedShipmentsIsMutable();
3338                   skippedShipments_.add(m);
3339                 } else {
3340                   skippedShipmentsBuilder_.addMessage(m);
3341                 }
3342                 break;
3343               } // case 34
3344             case 42:
3345               {
3346                 com.google.cloud.optimization.v1.OptimizeToursValidationError m =
3347                     input.readMessage(
3348                         com.google.cloud.optimization.v1.OptimizeToursValidationError.parser(),
3349                         extensionRegistry);
3350                 if (validationErrorsBuilder_ == null) {
3351                   ensureValidationErrorsIsMutable();
3352                   validationErrors_.add(m);
3353                 } else {
3354                   validationErrorsBuilder_.addMessage(m);
3355                 }
3356                 break;
3357               } // case 42
3358             case 50:
3359               {
3360                 input.readMessage(getMetricsFieldBuilder().getBuilder(), extensionRegistry);
3361                 bitField0_ |= 0x00000010;
3362                 break;
3363               } // case 50
3364             default:
3365               {
3366                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
3367                   done = true; // was an endgroup tag
3368                 }
3369                 break;
3370               } // default:
3371           } // switch (tag)
3372         } // while (!done)
3373       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3374         throw e.unwrapIOException();
3375       } finally {
3376         onChanged();
3377       } // finally
3378       return this;
3379     }
3380 
3381     private int bitField0_;
3382 
3383     private java.util.List<com.google.cloud.optimization.v1.ShipmentRoute> routes_ =
3384         java.util.Collections.emptyList();
3385 
ensureRoutesIsMutable()3386     private void ensureRoutesIsMutable() {
3387       if (!((bitField0_ & 0x00000001) != 0)) {
3388         routes_ = new java.util.ArrayList<com.google.cloud.optimization.v1.ShipmentRoute>(routes_);
3389         bitField0_ |= 0x00000001;
3390       }
3391     }
3392 
3393     private com.google.protobuf.RepeatedFieldBuilderV3<
3394             com.google.cloud.optimization.v1.ShipmentRoute,
3395             com.google.cloud.optimization.v1.ShipmentRoute.Builder,
3396             com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>
3397         routesBuilder_;
3398 
3399     /**
3400      *
3401      *
3402      * <pre>
3403      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3404      * vehicle in the model.
3405      * </pre>
3406      *
3407      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3408      */
getRoutesList()3409     public java.util.List<com.google.cloud.optimization.v1.ShipmentRoute> getRoutesList() {
3410       if (routesBuilder_ == null) {
3411         return java.util.Collections.unmodifiableList(routes_);
3412       } else {
3413         return routesBuilder_.getMessageList();
3414       }
3415     }
3416     /**
3417      *
3418      *
3419      * <pre>
3420      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3421      * vehicle in the model.
3422      * </pre>
3423      *
3424      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3425      */
getRoutesCount()3426     public int getRoutesCount() {
3427       if (routesBuilder_ == null) {
3428         return routes_.size();
3429       } else {
3430         return routesBuilder_.getCount();
3431       }
3432     }
3433     /**
3434      *
3435      *
3436      * <pre>
3437      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3438      * vehicle in the model.
3439      * </pre>
3440      *
3441      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3442      */
getRoutes(int index)3443     public com.google.cloud.optimization.v1.ShipmentRoute getRoutes(int index) {
3444       if (routesBuilder_ == null) {
3445         return routes_.get(index);
3446       } else {
3447         return routesBuilder_.getMessage(index);
3448       }
3449     }
3450     /**
3451      *
3452      *
3453      * <pre>
3454      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3455      * vehicle in the model.
3456      * </pre>
3457      *
3458      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3459      */
setRoutes(int index, com.google.cloud.optimization.v1.ShipmentRoute value)3460     public Builder setRoutes(int index, com.google.cloud.optimization.v1.ShipmentRoute value) {
3461       if (routesBuilder_ == null) {
3462         if (value == null) {
3463           throw new NullPointerException();
3464         }
3465         ensureRoutesIsMutable();
3466         routes_.set(index, value);
3467         onChanged();
3468       } else {
3469         routesBuilder_.setMessage(index, value);
3470       }
3471       return this;
3472     }
3473     /**
3474      *
3475      *
3476      * <pre>
3477      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3478      * vehicle in the model.
3479      * </pre>
3480      *
3481      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3482      */
setRoutes( int index, com.google.cloud.optimization.v1.ShipmentRoute.Builder builderForValue)3483     public Builder setRoutes(
3484         int index, com.google.cloud.optimization.v1.ShipmentRoute.Builder builderForValue) {
3485       if (routesBuilder_ == null) {
3486         ensureRoutesIsMutable();
3487         routes_.set(index, builderForValue.build());
3488         onChanged();
3489       } else {
3490         routesBuilder_.setMessage(index, builderForValue.build());
3491       }
3492       return this;
3493     }
3494     /**
3495      *
3496      *
3497      * <pre>
3498      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3499      * vehicle in the model.
3500      * </pre>
3501      *
3502      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3503      */
addRoutes(com.google.cloud.optimization.v1.ShipmentRoute value)3504     public Builder addRoutes(com.google.cloud.optimization.v1.ShipmentRoute value) {
3505       if (routesBuilder_ == null) {
3506         if (value == null) {
3507           throw new NullPointerException();
3508         }
3509         ensureRoutesIsMutable();
3510         routes_.add(value);
3511         onChanged();
3512       } else {
3513         routesBuilder_.addMessage(value);
3514       }
3515       return this;
3516     }
3517     /**
3518      *
3519      *
3520      * <pre>
3521      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3522      * vehicle in the model.
3523      * </pre>
3524      *
3525      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3526      */
addRoutes(int index, com.google.cloud.optimization.v1.ShipmentRoute value)3527     public Builder addRoutes(int index, com.google.cloud.optimization.v1.ShipmentRoute value) {
3528       if (routesBuilder_ == null) {
3529         if (value == null) {
3530           throw new NullPointerException();
3531         }
3532         ensureRoutesIsMutable();
3533         routes_.add(index, value);
3534         onChanged();
3535       } else {
3536         routesBuilder_.addMessage(index, value);
3537       }
3538       return this;
3539     }
3540     /**
3541      *
3542      *
3543      * <pre>
3544      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3545      * vehicle in the model.
3546      * </pre>
3547      *
3548      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3549      */
addRoutes( com.google.cloud.optimization.v1.ShipmentRoute.Builder builderForValue)3550     public Builder addRoutes(
3551         com.google.cloud.optimization.v1.ShipmentRoute.Builder builderForValue) {
3552       if (routesBuilder_ == null) {
3553         ensureRoutesIsMutable();
3554         routes_.add(builderForValue.build());
3555         onChanged();
3556       } else {
3557         routesBuilder_.addMessage(builderForValue.build());
3558       }
3559       return this;
3560     }
3561     /**
3562      *
3563      *
3564      * <pre>
3565      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3566      * vehicle in the model.
3567      * </pre>
3568      *
3569      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3570      */
addRoutes( int index, com.google.cloud.optimization.v1.ShipmentRoute.Builder builderForValue)3571     public Builder addRoutes(
3572         int index, com.google.cloud.optimization.v1.ShipmentRoute.Builder builderForValue) {
3573       if (routesBuilder_ == null) {
3574         ensureRoutesIsMutable();
3575         routes_.add(index, builderForValue.build());
3576         onChanged();
3577       } else {
3578         routesBuilder_.addMessage(index, builderForValue.build());
3579       }
3580       return this;
3581     }
3582     /**
3583      *
3584      *
3585      * <pre>
3586      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3587      * vehicle in the model.
3588      * </pre>
3589      *
3590      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3591      */
addAllRoutes( java.lang.Iterable<? extends com.google.cloud.optimization.v1.ShipmentRoute> values)3592     public Builder addAllRoutes(
3593         java.lang.Iterable<? extends com.google.cloud.optimization.v1.ShipmentRoute> values) {
3594       if (routesBuilder_ == null) {
3595         ensureRoutesIsMutable();
3596         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, routes_);
3597         onChanged();
3598       } else {
3599         routesBuilder_.addAllMessages(values);
3600       }
3601       return this;
3602     }
3603     /**
3604      *
3605      *
3606      * <pre>
3607      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3608      * vehicle in the model.
3609      * </pre>
3610      *
3611      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3612      */
clearRoutes()3613     public Builder clearRoutes() {
3614       if (routesBuilder_ == null) {
3615         routes_ = java.util.Collections.emptyList();
3616         bitField0_ = (bitField0_ & ~0x00000001);
3617         onChanged();
3618       } else {
3619         routesBuilder_.clear();
3620       }
3621       return this;
3622     }
3623     /**
3624      *
3625      *
3626      * <pre>
3627      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3628      * vehicle in the model.
3629      * </pre>
3630      *
3631      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3632      */
removeRoutes(int index)3633     public Builder removeRoutes(int index) {
3634       if (routesBuilder_ == null) {
3635         ensureRoutesIsMutable();
3636         routes_.remove(index);
3637         onChanged();
3638       } else {
3639         routesBuilder_.remove(index);
3640       }
3641       return this;
3642     }
3643     /**
3644      *
3645      *
3646      * <pre>
3647      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3648      * vehicle in the model.
3649      * </pre>
3650      *
3651      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3652      */
getRoutesBuilder(int index)3653     public com.google.cloud.optimization.v1.ShipmentRoute.Builder getRoutesBuilder(int index) {
3654       return getRoutesFieldBuilder().getBuilder(index);
3655     }
3656     /**
3657      *
3658      *
3659      * <pre>
3660      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3661      * vehicle in the model.
3662      * </pre>
3663      *
3664      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3665      */
getRoutesOrBuilder(int index)3666     public com.google.cloud.optimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder(int index) {
3667       if (routesBuilder_ == null) {
3668         return routes_.get(index);
3669       } else {
3670         return routesBuilder_.getMessageOrBuilder(index);
3671       }
3672     }
3673     /**
3674      *
3675      *
3676      * <pre>
3677      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3678      * vehicle in the model.
3679      * </pre>
3680      *
3681      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3682      */
3683     public java.util.List<? extends com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>
getRoutesOrBuilderList()3684         getRoutesOrBuilderList() {
3685       if (routesBuilder_ != null) {
3686         return routesBuilder_.getMessageOrBuilderList();
3687       } else {
3688         return java.util.Collections.unmodifiableList(routes_);
3689       }
3690     }
3691     /**
3692      *
3693      *
3694      * <pre>
3695      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3696      * vehicle in the model.
3697      * </pre>
3698      *
3699      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3700      */
addRoutesBuilder()3701     public com.google.cloud.optimization.v1.ShipmentRoute.Builder addRoutesBuilder() {
3702       return getRoutesFieldBuilder()
3703           .addBuilder(com.google.cloud.optimization.v1.ShipmentRoute.getDefaultInstance());
3704     }
3705     /**
3706      *
3707      *
3708      * <pre>
3709      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3710      * vehicle in the model.
3711      * </pre>
3712      *
3713      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3714      */
addRoutesBuilder(int index)3715     public com.google.cloud.optimization.v1.ShipmentRoute.Builder addRoutesBuilder(int index) {
3716       return getRoutesFieldBuilder()
3717           .addBuilder(index, com.google.cloud.optimization.v1.ShipmentRoute.getDefaultInstance());
3718     }
3719     /**
3720      *
3721      *
3722      * <pre>
3723      * Routes computed for each vehicle; the i-th route corresponds to the i-th
3724      * vehicle in the model.
3725      * </pre>
3726      *
3727      * <code>repeated .google.cloud.optimization.v1.ShipmentRoute routes = 1;</code>
3728      */
3729     public java.util.List<com.google.cloud.optimization.v1.ShipmentRoute.Builder>
getRoutesBuilderList()3730         getRoutesBuilderList() {
3731       return getRoutesFieldBuilder().getBuilderList();
3732     }
3733 
3734     private com.google.protobuf.RepeatedFieldBuilderV3<
3735             com.google.cloud.optimization.v1.ShipmentRoute,
3736             com.google.cloud.optimization.v1.ShipmentRoute.Builder,
3737             com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>
getRoutesFieldBuilder()3738         getRoutesFieldBuilder() {
3739       if (routesBuilder_ == null) {
3740         routesBuilder_ =
3741             new com.google.protobuf.RepeatedFieldBuilderV3<
3742                 com.google.cloud.optimization.v1.ShipmentRoute,
3743                 com.google.cloud.optimization.v1.ShipmentRoute.Builder,
3744                 com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>(
3745                 routes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
3746         routes_ = null;
3747       }
3748       return routesBuilder_;
3749     }
3750 
3751     private java.lang.Object requestLabel_ = "";
3752     /**
3753      *
3754      *
3755      * <pre>
3756      * Copy of the
3757      * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
3758      * if a label was specified in the request.
3759      * </pre>
3760      *
3761      * <code>string request_label = 3;</code>
3762      *
3763      * @return The requestLabel.
3764      */
getRequestLabel()3765     public java.lang.String getRequestLabel() {
3766       java.lang.Object ref = requestLabel_;
3767       if (!(ref instanceof java.lang.String)) {
3768         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3769         java.lang.String s = bs.toStringUtf8();
3770         requestLabel_ = s;
3771         return s;
3772       } else {
3773         return (java.lang.String) ref;
3774       }
3775     }
3776     /**
3777      *
3778      *
3779      * <pre>
3780      * Copy of the
3781      * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
3782      * if a label was specified in the request.
3783      * </pre>
3784      *
3785      * <code>string request_label = 3;</code>
3786      *
3787      * @return The bytes for requestLabel.
3788      */
getRequestLabelBytes()3789     public com.google.protobuf.ByteString getRequestLabelBytes() {
3790       java.lang.Object ref = requestLabel_;
3791       if (ref instanceof String) {
3792         com.google.protobuf.ByteString b =
3793             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3794         requestLabel_ = b;
3795         return b;
3796       } else {
3797         return (com.google.protobuf.ByteString) ref;
3798       }
3799     }
3800     /**
3801      *
3802      *
3803      * <pre>
3804      * Copy of the
3805      * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
3806      * if a label was specified in the request.
3807      * </pre>
3808      *
3809      * <code>string request_label = 3;</code>
3810      *
3811      * @param value The requestLabel to set.
3812      * @return This builder for chaining.
3813      */
setRequestLabel(java.lang.String value)3814     public Builder setRequestLabel(java.lang.String value) {
3815       if (value == null) {
3816         throw new NullPointerException();
3817       }
3818       requestLabel_ = value;
3819       bitField0_ |= 0x00000002;
3820       onChanged();
3821       return this;
3822     }
3823     /**
3824      *
3825      *
3826      * <pre>
3827      * Copy of the
3828      * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
3829      * if a label was specified in the request.
3830      * </pre>
3831      *
3832      * <code>string request_label = 3;</code>
3833      *
3834      * @return This builder for chaining.
3835      */
clearRequestLabel()3836     public Builder clearRequestLabel() {
3837       requestLabel_ = getDefaultInstance().getRequestLabel();
3838       bitField0_ = (bitField0_ & ~0x00000002);
3839       onChanged();
3840       return this;
3841     }
3842     /**
3843      *
3844      *
3845      * <pre>
3846      * Copy of the
3847      * [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label],
3848      * if a label was specified in the request.
3849      * </pre>
3850      *
3851      * <code>string request_label = 3;</code>
3852      *
3853      * @param value The bytes for requestLabel to set.
3854      * @return This builder for chaining.
3855      */
setRequestLabelBytes(com.google.protobuf.ByteString value)3856     public Builder setRequestLabelBytes(com.google.protobuf.ByteString value) {
3857       if (value == null) {
3858         throw new NullPointerException();
3859       }
3860       checkByteStringIsUtf8(value);
3861       requestLabel_ = value;
3862       bitField0_ |= 0x00000002;
3863       onChanged();
3864       return this;
3865     }
3866 
3867     private java.util.List<com.google.cloud.optimization.v1.SkippedShipment> skippedShipments_ =
3868         java.util.Collections.emptyList();
3869 
ensureSkippedShipmentsIsMutable()3870     private void ensureSkippedShipmentsIsMutable() {
3871       if (!((bitField0_ & 0x00000004) != 0)) {
3872         skippedShipments_ =
3873             new java.util.ArrayList<com.google.cloud.optimization.v1.SkippedShipment>(
3874                 skippedShipments_);
3875         bitField0_ |= 0x00000004;
3876       }
3877     }
3878 
3879     private com.google.protobuf.RepeatedFieldBuilderV3<
3880             com.google.cloud.optimization.v1.SkippedShipment,
3881             com.google.cloud.optimization.v1.SkippedShipment.Builder,
3882             com.google.cloud.optimization.v1.SkippedShipmentOrBuilder>
3883         skippedShipmentsBuilder_;
3884 
3885     /**
3886      *
3887      *
3888      * <pre>
3889      * The list of all shipments skipped.
3890      * </pre>
3891      *
3892      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
3893      */
3894     public java.util.List<com.google.cloud.optimization.v1.SkippedShipment>
getSkippedShipmentsList()3895         getSkippedShipmentsList() {
3896       if (skippedShipmentsBuilder_ == null) {
3897         return java.util.Collections.unmodifiableList(skippedShipments_);
3898       } else {
3899         return skippedShipmentsBuilder_.getMessageList();
3900       }
3901     }
3902     /**
3903      *
3904      *
3905      * <pre>
3906      * The list of all shipments skipped.
3907      * </pre>
3908      *
3909      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
3910      */
getSkippedShipmentsCount()3911     public int getSkippedShipmentsCount() {
3912       if (skippedShipmentsBuilder_ == null) {
3913         return skippedShipments_.size();
3914       } else {
3915         return skippedShipmentsBuilder_.getCount();
3916       }
3917     }
3918     /**
3919      *
3920      *
3921      * <pre>
3922      * The list of all shipments skipped.
3923      * </pre>
3924      *
3925      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
3926      */
getSkippedShipments(int index)3927     public com.google.cloud.optimization.v1.SkippedShipment getSkippedShipments(int index) {
3928       if (skippedShipmentsBuilder_ == null) {
3929         return skippedShipments_.get(index);
3930       } else {
3931         return skippedShipmentsBuilder_.getMessage(index);
3932       }
3933     }
3934     /**
3935      *
3936      *
3937      * <pre>
3938      * The list of all shipments skipped.
3939      * </pre>
3940      *
3941      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
3942      */
setSkippedShipments( int index, com.google.cloud.optimization.v1.SkippedShipment value)3943     public Builder setSkippedShipments(
3944         int index, com.google.cloud.optimization.v1.SkippedShipment value) {
3945       if (skippedShipmentsBuilder_ == null) {
3946         if (value == null) {
3947           throw new NullPointerException();
3948         }
3949         ensureSkippedShipmentsIsMutable();
3950         skippedShipments_.set(index, value);
3951         onChanged();
3952       } else {
3953         skippedShipmentsBuilder_.setMessage(index, value);
3954       }
3955       return this;
3956     }
3957     /**
3958      *
3959      *
3960      * <pre>
3961      * The list of all shipments skipped.
3962      * </pre>
3963      *
3964      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
3965      */
setSkippedShipments( int index, com.google.cloud.optimization.v1.SkippedShipment.Builder builderForValue)3966     public Builder setSkippedShipments(
3967         int index, com.google.cloud.optimization.v1.SkippedShipment.Builder builderForValue) {
3968       if (skippedShipmentsBuilder_ == null) {
3969         ensureSkippedShipmentsIsMutable();
3970         skippedShipments_.set(index, builderForValue.build());
3971         onChanged();
3972       } else {
3973         skippedShipmentsBuilder_.setMessage(index, builderForValue.build());
3974       }
3975       return this;
3976     }
3977     /**
3978      *
3979      *
3980      * <pre>
3981      * The list of all shipments skipped.
3982      * </pre>
3983      *
3984      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
3985      */
addSkippedShipments(com.google.cloud.optimization.v1.SkippedShipment value)3986     public Builder addSkippedShipments(com.google.cloud.optimization.v1.SkippedShipment value) {
3987       if (skippedShipmentsBuilder_ == null) {
3988         if (value == null) {
3989           throw new NullPointerException();
3990         }
3991         ensureSkippedShipmentsIsMutable();
3992         skippedShipments_.add(value);
3993         onChanged();
3994       } else {
3995         skippedShipmentsBuilder_.addMessage(value);
3996       }
3997       return this;
3998     }
3999     /**
4000      *
4001      *
4002      * <pre>
4003      * The list of all shipments skipped.
4004      * </pre>
4005      *
4006      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4007      */
addSkippedShipments( int index, com.google.cloud.optimization.v1.SkippedShipment value)4008     public Builder addSkippedShipments(
4009         int index, com.google.cloud.optimization.v1.SkippedShipment value) {
4010       if (skippedShipmentsBuilder_ == null) {
4011         if (value == null) {
4012           throw new NullPointerException();
4013         }
4014         ensureSkippedShipmentsIsMutable();
4015         skippedShipments_.add(index, value);
4016         onChanged();
4017       } else {
4018         skippedShipmentsBuilder_.addMessage(index, value);
4019       }
4020       return this;
4021     }
4022     /**
4023      *
4024      *
4025      * <pre>
4026      * The list of all shipments skipped.
4027      * </pre>
4028      *
4029      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4030      */
addSkippedShipments( com.google.cloud.optimization.v1.SkippedShipment.Builder builderForValue)4031     public Builder addSkippedShipments(
4032         com.google.cloud.optimization.v1.SkippedShipment.Builder builderForValue) {
4033       if (skippedShipmentsBuilder_ == null) {
4034         ensureSkippedShipmentsIsMutable();
4035         skippedShipments_.add(builderForValue.build());
4036         onChanged();
4037       } else {
4038         skippedShipmentsBuilder_.addMessage(builderForValue.build());
4039       }
4040       return this;
4041     }
4042     /**
4043      *
4044      *
4045      * <pre>
4046      * The list of all shipments skipped.
4047      * </pre>
4048      *
4049      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4050      */
addSkippedShipments( int index, com.google.cloud.optimization.v1.SkippedShipment.Builder builderForValue)4051     public Builder addSkippedShipments(
4052         int index, com.google.cloud.optimization.v1.SkippedShipment.Builder builderForValue) {
4053       if (skippedShipmentsBuilder_ == null) {
4054         ensureSkippedShipmentsIsMutable();
4055         skippedShipments_.add(index, builderForValue.build());
4056         onChanged();
4057       } else {
4058         skippedShipmentsBuilder_.addMessage(index, builderForValue.build());
4059       }
4060       return this;
4061     }
4062     /**
4063      *
4064      *
4065      * <pre>
4066      * The list of all shipments skipped.
4067      * </pre>
4068      *
4069      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4070      */
addAllSkippedShipments( java.lang.Iterable<? extends com.google.cloud.optimization.v1.SkippedShipment> values)4071     public Builder addAllSkippedShipments(
4072         java.lang.Iterable<? extends com.google.cloud.optimization.v1.SkippedShipment> values) {
4073       if (skippedShipmentsBuilder_ == null) {
4074         ensureSkippedShipmentsIsMutable();
4075         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, skippedShipments_);
4076         onChanged();
4077       } else {
4078         skippedShipmentsBuilder_.addAllMessages(values);
4079       }
4080       return this;
4081     }
4082     /**
4083      *
4084      *
4085      * <pre>
4086      * The list of all shipments skipped.
4087      * </pre>
4088      *
4089      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4090      */
clearSkippedShipments()4091     public Builder clearSkippedShipments() {
4092       if (skippedShipmentsBuilder_ == null) {
4093         skippedShipments_ = java.util.Collections.emptyList();
4094         bitField0_ = (bitField0_ & ~0x00000004);
4095         onChanged();
4096       } else {
4097         skippedShipmentsBuilder_.clear();
4098       }
4099       return this;
4100     }
4101     /**
4102      *
4103      *
4104      * <pre>
4105      * The list of all shipments skipped.
4106      * </pre>
4107      *
4108      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4109      */
removeSkippedShipments(int index)4110     public Builder removeSkippedShipments(int index) {
4111       if (skippedShipmentsBuilder_ == null) {
4112         ensureSkippedShipmentsIsMutable();
4113         skippedShipments_.remove(index);
4114         onChanged();
4115       } else {
4116         skippedShipmentsBuilder_.remove(index);
4117       }
4118       return this;
4119     }
4120     /**
4121      *
4122      *
4123      * <pre>
4124      * The list of all shipments skipped.
4125      * </pre>
4126      *
4127      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4128      */
getSkippedShipmentsBuilder( int index)4129     public com.google.cloud.optimization.v1.SkippedShipment.Builder getSkippedShipmentsBuilder(
4130         int index) {
4131       return getSkippedShipmentsFieldBuilder().getBuilder(index);
4132     }
4133     /**
4134      *
4135      *
4136      * <pre>
4137      * The list of all shipments skipped.
4138      * </pre>
4139      *
4140      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4141      */
getSkippedShipmentsOrBuilder( int index)4142     public com.google.cloud.optimization.v1.SkippedShipmentOrBuilder getSkippedShipmentsOrBuilder(
4143         int index) {
4144       if (skippedShipmentsBuilder_ == null) {
4145         return skippedShipments_.get(index);
4146       } else {
4147         return skippedShipmentsBuilder_.getMessageOrBuilder(index);
4148       }
4149     }
4150     /**
4151      *
4152      *
4153      * <pre>
4154      * The list of all shipments skipped.
4155      * </pre>
4156      *
4157      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4158      */
4159     public java.util.List<? extends com.google.cloud.optimization.v1.SkippedShipmentOrBuilder>
getSkippedShipmentsOrBuilderList()4160         getSkippedShipmentsOrBuilderList() {
4161       if (skippedShipmentsBuilder_ != null) {
4162         return skippedShipmentsBuilder_.getMessageOrBuilderList();
4163       } else {
4164         return java.util.Collections.unmodifiableList(skippedShipments_);
4165       }
4166     }
4167     /**
4168      *
4169      *
4170      * <pre>
4171      * The list of all shipments skipped.
4172      * </pre>
4173      *
4174      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4175      */
addSkippedShipmentsBuilder()4176     public com.google.cloud.optimization.v1.SkippedShipment.Builder addSkippedShipmentsBuilder() {
4177       return getSkippedShipmentsFieldBuilder()
4178           .addBuilder(com.google.cloud.optimization.v1.SkippedShipment.getDefaultInstance());
4179     }
4180     /**
4181      *
4182      *
4183      * <pre>
4184      * The list of all shipments skipped.
4185      * </pre>
4186      *
4187      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4188      */
addSkippedShipmentsBuilder( int index)4189     public com.google.cloud.optimization.v1.SkippedShipment.Builder addSkippedShipmentsBuilder(
4190         int index) {
4191       return getSkippedShipmentsFieldBuilder()
4192           .addBuilder(index, com.google.cloud.optimization.v1.SkippedShipment.getDefaultInstance());
4193     }
4194     /**
4195      *
4196      *
4197      * <pre>
4198      * The list of all shipments skipped.
4199      * </pre>
4200      *
4201      * <code>repeated .google.cloud.optimization.v1.SkippedShipment skipped_shipments = 4;</code>
4202      */
4203     public java.util.List<com.google.cloud.optimization.v1.SkippedShipment.Builder>
getSkippedShipmentsBuilderList()4204         getSkippedShipmentsBuilderList() {
4205       return getSkippedShipmentsFieldBuilder().getBuilderList();
4206     }
4207 
4208     private com.google.protobuf.RepeatedFieldBuilderV3<
4209             com.google.cloud.optimization.v1.SkippedShipment,
4210             com.google.cloud.optimization.v1.SkippedShipment.Builder,
4211             com.google.cloud.optimization.v1.SkippedShipmentOrBuilder>
getSkippedShipmentsFieldBuilder()4212         getSkippedShipmentsFieldBuilder() {
4213       if (skippedShipmentsBuilder_ == null) {
4214         skippedShipmentsBuilder_ =
4215             new com.google.protobuf.RepeatedFieldBuilderV3<
4216                 com.google.cloud.optimization.v1.SkippedShipment,
4217                 com.google.cloud.optimization.v1.SkippedShipment.Builder,
4218                 com.google.cloud.optimization.v1.SkippedShipmentOrBuilder>(
4219                 skippedShipments_,
4220                 ((bitField0_ & 0x00000004) != 0),
4221                 getParentForChildren(),
4222                 isClean());
4223         skippedShipments_ = null;
4224       }
4225       return skippedShipmentsBuilder_;
4226     }
4227 
4228     private java.util.List<com.google.cloud.optimization.v1.OptimizeToursValidationError>
4229         validationErrors_ = java.util.Collections.emptyList();
4230 
ensureValidationErrorsIsMutable()4231     private void ensureValidationErrorsIsMutable() {
4232       if (!((bitField0_ & 0x00000008) != 0)) {
4233         validationErrors_ =
4234             new java.util.ArrayList<com.google.cloud.optimization.v1.OptimizeToursValidationError>(
4235                 validationErrors_);
4236         bitField0_ |= 0x00000008;
4237       }
4238     }
4239 
4240     private com.google.protobuf.RepeatedFieldBuilderV3<
4241             com.google.cloud.optimization.v1.OptimizeToursValidationError,
4242             com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder,
4243             com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder>
4244         validationErrorsBuilder_;
4245 
4246     /**
4247      *
4248      *
4249      * <pre>
4250      * List of all the validation errors that we were able to detect
4251      * independently. See the "MULTIPLE ERRORS" explanation for the
4252      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4253      * message.
4254      * </pre>
4255      *
4256      * <code>
4257      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4258      * </code>
4259      */
4260     public java.util.List<com.google.cloud.optimization.v1.OptimizeToursValidationError>
getValidationErrorsList()4261         getValidationErrorsList() {
4262       if (validationErrorsBuilder_ == null) {
4263         return java.util.Collections.unmodifiableList(validationErrors_);
4264       } else {
4265         return validationErrorsBuilder_.getMessageList();
4266       }
4267     }
4268     /**
4269      *
4270      *
4271      * <pre>
4272      * List of all the validation errors that we were able to detect
4273      * independently. See the "MULTIPLE ERRORS" explanation for the
4274      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4275      * message.
4276      * </pre>
4277      *
4278      * <code>
4279      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4280      * </code>
4281      */
getValidationErrorsCount()4282     public int getValidationErrorsCount() {
4283       if (validationErrorsBuilder_ == null) {
4284         return validationErrors_.size();
4285       } else {
4286         return validationErrorsBuilder_.getCount();
4287       }
4288     }
4289     /**
4290      *
4291      *
4292      * <pre>
4293      * List of all the validation errors that we were able to detect
4294      * independently. See the "MULTIPLE ERRORS" explanation for the
4295      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4296      * message.
4297      * </pre>
4298      *
4299      * <code>
4300      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4301      * </code>
4302      */
getValidationErrors( int index)4303     public com.google.cloud.optimization.v1.OptimizeToursValidationError getValidationErrors(
4304         int index) {
4305       if (validationErrorsBuilder_ == null) {
4306         return validationErrors_.get(index);
4307       } else {
4308         return validationErrorsBuilder_.getMessage(index);
4309       }
4310     }
4311     /**
4312      *
4313      *
4314      * <pre>
4315      * List of all the validation errors that we were able to detect
4316      * independently. See the "MULTIPLE ERRORS" explanation for the
4317      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4318      * message.
4319      * </pre>
4320      *
4321      * <code>
4322      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4323      * </code>
4324      */
setValidationErrors( int index, com.google.cloud.optimization.v1.OptimizeToursValidationError value)4325     public Builder setValidationErrors(
4326         int index, com.google.cloud.optimization.v1.OptimizeToursValidationError value) {
4327       if (validationErrorsBuilder_ == null) {
4328         if (value == null) {
4329           throw new NullPointerException();
4330         }
4331         ensureValidationErrorsIsMutable();
4332         validationErrors_.set(index, value);
4333         onChanged();
4334       } else {
4335         validationErrorsBuilder_.setMessage(index, value);
4336       }
4337       return this;
4338     }
4339     /**
4340      *
4341      *
4342      * <pre>
4343      * List of all the validation errors that we were able to detect
4344      * independently. See the "MULTIPLE ERRORS" explanation for the
4345      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4346      * message.
4347      * </pre>
4348      *
4349      * <code>
4350      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4351      * </code>
4352      */
setValidationErrors( int index, com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder builderForValue)4353     public Builder setValidationErrors(
4354         int index,
4355         com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder builderForValue) {
4356       if (validationErrorsBuilder_ == null) {
4357         ensureValidationErrorsIsMutable();
4358         validationErrors_.set(index, builderForValue.build());
4359         onChanged();
4360       } else {
4361         validationErrorsBuilder_.setMessage(index, builderForValue.build());
4362       }
4363       return this;
4364     }
4365     /**
4366      *
4367      *
4368      * <pre>
4369      * List of all the validation errors that we were able to detect
4370      * independently. See the "MULTIPLE ERRORS" explanation for the
4371      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4372      * message.
4373      * </pre>
4374      *
4375      * <code>
4376      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4377      * </code>
4378      */
addValidationErrors( com.google.cloud.optimization.v1.OptimizeToursValidationError value)4379     public Builder addValidationErrors(
4380         com.google.cloud.optimization.v1.OptimizeToursValidationError value) {
4381       if (validationErrorsBuilder_ == null) {
4382         if (value == null) {
4383           throw new NullPointerException();
4384         }
4385         ensureValidationErrorsIsMutable();
4386         validationErrors_.add(value);
4387         onChanged();
4388       } else {
4389         validationErrorsBuilder_.addMessage(value);
4390       }
4391       return this;
4392     }
4393     /**
4394      *
4395      *
4396      * <pre>
4397      * List of all the validation errors that we were able to detect
4398      * independently. See the "MULTIPLE ERRORS" explanation for the
4399      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4400      * message.
4401      * </pre>
4402      *
4403      * <code>
4404      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4405      * </code>
4406      */
addValidationErrors( int index, com.google.cloud.optimization.v1.OptimizeToursValidationError value)4407     public Builder addValidationErrors(
4408         int index, com.google.cloud.optimization.v1.OptimizeToursValidationError value) {
4409       if (validationErrorsBuilder_ == null) {
4410         if (value == null) {
4411           throw new NullPointerException();
4412         }
4413         ensureValidationErrorsIsMutable();
4414         validationErrors_.add(index, value);
4415         onChanged();
4416       } else {
4417         validationErrorsBuilder_.addMessage(index, value);
4418       }
4419       return this;
4420     }
4421     /**
4422      *
4423      *
4424      * <pre>
4425      * List of all the validation errors that we were able to detect
4426      * independently. See the "MULTIPLE ERRORS" explanation for the
4427      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4428      * message.
4429      * </pre>
4430      *
4431      * <code>
4432      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4433      * </code>
4434      */
addValidationErrors( com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder builderForValue)4435     public Builder addValidationErrors(
4436         com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder builderForValue) {
4437       if (validationErrorsBuilder_ == null) {
4438         ensureValidationErrorsIsMutable();
4439         validationErrors_.add(builderForValue.build());
4440         onChanged();
4441       } else {
4442         validationErrorsBuilder_.addMessage(builderForValue.build());
4443       }
4444       return this;
4445     }
4446     /**
4447      *
4448      *
4449      * <pre>
4450      * List of all the validation errors that we were able to detect
4451      * independently. See the "MULTIPLE ERRORS" explanation for the
4452      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4453      * message.
4454      * </pre>
4455      *
4456      * <code>
4457      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4458      * </code>
4459      */
addValidationErrors( int index, com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder builderForValue)4460     public Builder addValidationErrors(
4461         int index,
4462         com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder builderForValue) {
4463       if (validationErrorsBuilder_ == null) {
4464         ensureValidationErrorsIsMutable();
4465         validationErrors_.add(index, builderForValue.build());
4466         onChanged();
4467       } else {
4468         validationErrorsBuilder_.addMessage(index, builderForValue.build());
4469       }
4470       return this;
4471     }
4472     /**
4473      *
4474      *
4475      * <pre>
4476      * List of all the validation errors that we were able to detect
4477      * independently. See the "MULTIPLE ERRORS" explanation for the
4478      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4479      * message.
4480      * </pre>
4481      *
4482      * <code>
4483      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4484      * </code>
4485      */
addAllValidationErrors( java.lang.Iterable<? extends com.google.cloud.optimization.v1.OptimizeToursValidationError> values)4486     public Builder addAllValidationErrors(
4487         java.lang.Iterable<? extends com.google.cloud.optimization.v1.OptimizeToursValidationError>
4488             values) {
4489       if (validationErrorsBuilder_ == null) {
4490         ensureValidationErrorsIsMutable();
4491         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, validationErrors_);
4492         onChanged();
4493       } else {
4494         validationErrorsBuilder_.addAllMessages(values);
4495       }
4496       return this;
4497     }
4498     /**
4499      *
4500      *
4501      * <pre>
4502      * List of all the validation errors that we were able to detect
4503      * independently. See the "MULTIPLE ERRORS" explanation for the
4504      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4505      * message.
4506      * </pre>
4507      *
4508      * <code>
4509      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4510      * </code>
4511      */
clearValidationErrors()4512     public Builder clearValidationErrors() {
4513       if (validationErrorsBuilder_ == null) {
4514         validationErrors_ = java.util.Collections.emptyList();
4515         bitField0_ = (bitField0_ & ~0x00000008);
4516         onChanged();
4517       } else {
4518         validationErrorsBuilder_.clear();
4519       }
4520       return this;
4521     }
4522     /**
4523      *
4524      *
4525      * <pre>
4526      * List of all the validation errors that we were able to detect
4527      * independently. See the "MULTIPLE ERRORS" explanation for the
4528      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4529      * message.
4530      * </pre>
4531      *
4532      * <code>
4533      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4534      * </code>
4535      */
removeValidationErrors(int index)4536     public Builder removeValidationErrors(int index) {
4537       if (validationErrorsBuilder_ == null) {
4538         ensureValidationErrorsIsMutable();
4539         validationErrors_.remove(index);
4540         onChanged();
4541       } else {
4542         validationErrorsBuilder_.remove(index);
4543       }
4544       return this;
4545     }
4546     /**
4547      *
4548      *
4549      * <pre>
4550      * List of all the validation errors that we were able to detect
4551      * independently. See the "MULTIPLE ERRORS" explanation for the
4552      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4553      * message.
4554      * </pre>
4555      *
4556      * <code>
4557      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4558      * </code>
4559      */
4560     public com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder
getValidationErrorsBuilder(int index)4561         getValidationErrorsBuilder(int index) {
4562       return getValidationErrorsFieldBuilder().getBuilder(index);
4563     }
4564     /**
4565      *
4566      *
4567      * <pre>
4568      * List of all the validation errors that we were able to detect
4569      * independently. See the "MULTIPLE ERRORS" explanation for the
4570      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4571      * message.
4572      * </pre>
4573      *
4574      * <code>
4575      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4576      * </code>
4577      */
4578     public com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder
getValidationErrorsOrBuilder(int index)4579         getValidationErrorsOrBuilder(int index) {
4580       if (validationErrorsBuilder_ == null) {
4581         return validationErrors_.get(index);
4582       } else {
4583         return validationErrorsBuilder_.getMessageOrBuilder(index);
4584       }
4585     }
4586     /**
4587      *
4588      *
4589      * <pre>
4590      * List of all the validation errors that we were able to detect
4591      * independently. See the "MULTIPLE ERRORS" explanation for the
4592      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4593      * message.
4594      * </pre>
4595      *
4596      * <code>
4597      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4598      * </code>
4599      */
4600     public java.util.List<
4601             ? extends com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder>
getValidationErrorsOrBuilderList()4602         getValidationErrorsOrBuilderList() {
4603       if (validationErrorsBuilder_ != null) {
4604         return validationErrorsBuilder_.getMessageOrBuilderList();
4605       } else {
4606         return java.util.Collections.unmodifiableList(validationErrors_);
4607       }
4608     }
4609     /**
4610      *
4611      *
4612      * <pre>
4613      * List of all the validation errors that we were able to detect
4614      * independently. See the "MULTIPLE ERRORS" explanation for the
4615      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4616      * message.
4617      * </pre>
4618      *
4619      * <code>
4620      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4621      * </code>
4622      */
4623     public com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder
addValidationErrorsBuilder()4624         addValidationErrorsBuilder() {
4625       return getValidationErrorsFieldBuilder()
4626           .addBuilder(
4627               com.google.cloud.optimization.v1.OptimizeToursValidationError.getDefaultInstance());
4628     }
4629     /**
4630      *
4631      *
4632      * <pre>
4633      * List of all the validation errors that we were able to detect
4634      * independently. See the "MULTIPLE ERRORS" explanation for the
4635      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4636      * message.
4637      * </pre>
4638      *
4639      * <code>
4640      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4641      * </code>
4642      */
4643     public com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder
addValidationErrorsBuilder(int index)4644         addValidationErrorsBuilder(int index) {
4645       return getValidationErrorsFieldBuilder()
4646           .addBuilder(
4647               index,
4648               com.google.cloud.optimization.v1.OptimizeToursValidationError.getDefaultInstance());
4649     }
4650     /**
4651      *
4652      *
4653      * <pre>
4654      * List of all the validation errors that we were able to detect
4655      * independently. See the "MULTIPLE ERRORS" explanation for the
4656      * [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError]
4657      * message.
4658      * </pre>
4659      *
4660      * <code>
4661      * repeated .google.cloud.optimization.v1.OptimizeToursValidationError validation_errors = 5;
4662      * </code>
4663      */
4664     public java.util.List<com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder>
getValidationErrorsBuilderList()4665         getValidationErrorsBuilderList() {
4666       return getValidationErrorsFieldBuilder().getBuilderList();
4667     }
4668 
4669     private com.google.protobuf.RepeatedFieldBuilderV3<
4670             com.google.cloud.optimization.v1.OptimizeToursValidationError,
4671             com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder,
4672             com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder>
getValidationErrorsFieldBuilder()4673         getValidationErrorsFieldBuilder() {
4674       if (validationErrorsBuilder_ == null) {
4675         validationErrorsBuilder_ =
4676             new com.google.protobuf.RepeatedFieldBuilderV3<
4677                 com.google.cloud.optimization.v1.OptimizeToursValidationError,
4678                 com.google.cloud.optimization.v1.OptimizeToursValidationError.Builder,
4679                 com.google.cloud.optimization.v1.OptimizeToursValidationErrorOrBuilder>(
4680                 validationErrors_,
4681                 ((bitField0_ & 0x00000008) != 0),
4682                 getParentForChildren(),
4683                 isClean());
4684         validationErrors_ = null;
4685       }
4686       return validationErrorsBuilder_;
4687     }
4688 
4689     private com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics_;
4690     private com.google.protobuf.SingleFieldBuilderV3<
4691             com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics,
4692             com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder,
4693             com.google.cloud.optimization.v1.OptimizeToursResponse.MetricsOrBuilder>
4694         metricsBuilder_;
4695     /**
4696      *
4697      *
4698      * <pre>
4699      * Duration, distance and usage metrics for this solution.
4700      * </pre>
4701      *
4702      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4703      *
4704      * @return Whether the metrics field is set.
4705      */
hasMetrics()4706     public boolean hasMetrics() {
4707       return ((bitField0_ & 0x00000010) != 0);
4708     }
4709     /**
4710      *
4711      *
4712      * <pre>
4713      * Duration, distance and usage metrics for this solution.
4714      * </pre>
4715      *
4716      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4717      *
4718      * @return The metrics.
4719      */
getMetrics()4720     public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics getMetrics() {
4721       if (metricsBuilder_ == null) {
4722         return metrics_ == null
4723             ? com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance()
4724             : metrics_;
4725       } else {
4726         return metricsBuilder_.getMessage();
4727       }
4728     }
4729     /**
4730      *
4731      *
4732      * <pre>
4733      * Duration, distance and usage metrics for this solution.
4734      * </pre>
4735      *
4736      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4737      */
setMetrics( com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics value)4738     public Builder setMetrics(
4739         com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics value) {
4740       if (metricsBuilder_ == null) {
4741         if (value == null) {
4742           throw new NullPointerException();
4743         }
4744         metrics_ = value;
4745       } else {
4746         metricsBuilder_.setMessage(value);
4747       }
4748       bitField0_ |= 0x00000010;
4749       onChanged();
4750       return this;
4751     }
4752     /**
4753      *
4754      *
4755      * <pre>
4756      * Duration, distance and usage metrics for this solution.
4757      * </pre>
4758      *
4759      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4760      */
setMetrics( com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder builderForValue)4761     public Builder setMetrics(
4762         com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder builderForValue) {
4763       if (metricsBuilder_ == null) {
4764         metrics_ = builderForValue.build();
4765       } else {
4766         metricsBuilder_.setMessage(builderForValue.build());
4767       }
4768       bitField0_ |= 0x00000010;
4769       onChanged();
4770       return this;
4771     }
4772     /**
4773      *
4774      *
4775      * <pre>
4776      * Duration, distance and usage metrics for this solution.
4777      * </pre>
4778      *
4779      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4780      */
mergeMetrics( com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics value)4781     public Builder mergeMetrics(
4782         com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics value) {
4783       if (metricsBuilder_ == null) {
4784         if (((bitField0_ & 0x00000010) != 0)
4785             && metrics_ != null
4786             && metrics_
4787                 != com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics
4788                     .getDefaultInstance()) {
4789           getMetricsBuilder().mergeFrom(value);
4790         } else {
4791           metrics_ = value;
4792         }
4793       } else {
4794         metricsBuilder_.mergeFrom(value);
4795       }
4796       bitField0_ |= 0x00000010;
4797       onChanged();
4798       return this;
4799     }
4800     /**
4801      *
4802      *
4803      * <pre>
4804      * Duration, distance and usage metrics for this solution.
4805      * </pre>
4806      *
4807      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4808      */
clearMetrics()4809     public Builder clearMetrics() {
4810       bitField0_ = (bitField0_ & ~0x00000010);
4811       metrics_ = null;
4812       if (metricsBuilder_ != null) {
4813         metricsBuilder_.dispose();
4814         metricsBuilder_ = null;
4815       }
4816       onChanged();
4817       return this;
4818     }
4819     /**
4820      *
4821      *
4822      * <pre>
4823      * Duration, distance and usage metrics for this solution.
4824      * </pre>
4825      *
4826      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4827      */
4828     public com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder
getMetricsBuilder()4829         getMetricsBuilder() {
4830       bitField0_ |= 0x00000010;
4831       onChanged();
4832       return getMetricsFieldBuilder().getBuilder();
4833     }
4834     /**
4835      *
4836      *
4837      * <pre>
4838      * Duration, distance and usage metrics for this solution.
4839      * </pre>
4840      *
4841      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4842      */
4843     public com.google.cloud.optimization.v1.OptimizeToursResponse.MetricsOrBuilder
getMetricsOrBuilder()4844         getMetricsOrBuilder() {
4845       if (metricsBuilder_ != null) {
4846         return metricsBuilder_.getMessageOrBuilder();
4847       } else {
4848         return metrics_ == null
4849             ? com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance()
4850             : metrics_;
4851       }
4852     }
4853     /**
4854      *
4855      *
4856      * <pre>
4857      * Duration, distance and usage metrics for this solution.
4858      * </pre>
4859      *
4860      * <code>.google.cloud.optimization.v1.OptimizeToursResponse.Metrics metrics = 6;</code>
4861      */
4862     private com.google.protobuf.SingleFieldBuilderV3<
4863             com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics,
4864             com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder,
4865             com.google.cloud.optimization.v1.OptimizeToursResponse.MetricsOrBuilder>
getMetricsFieldBuilder()4866         getMetricsFieldBuilder() {
4867       if (metricsBuilder_ == null) {
4868         metricsBuilder_ =
4869             new com.google.protobuf.SingleFieldBuilderV3<
4870                 com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics,
4871                 com.google.cloud.optimization.v1.OptimizeToursResponse.Metrics.Builder,
4872                 com.google.cloud.optimization.v1.OptimizeToursResponse.MetricsOrBuilder>(
4873                 getMetrics(), getParentForChildren(), isClean());
4874         metrics_ = null;
4875       }
4876       return metricsBuilder_;
4877     }
4878 
4879     private double totalCost_;
4880     /**
4881      *
4882      *
4883      * <pre>
4884      * Deprecated: Use
4885      * [Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
4886      * instead. Total cost of the solution. This takes into account all costs:
4887      * costs per per hour and travel hour, fixed vehicle costs, unperformed
4888      * shipment penalty costs, global duration cost, etc.
4889      * </pre>
4890      *
4891      * <code>double total_cost = 2 [deprecated = true];</code>
4892      *
4893      * @deprecated google.cloud.optimization.v1.OptimizeToursResponse.total_cost is deprecated. See
4894      *     google/cloud/optimization/v1/fleet_routing.proto;l=425
4895      * @return The totalCost.
4896      */
4897     @java.lang.Override
4898     @java.lang.Deprecated
getTotalCost()4899     public double getTotalCost() {
4900       return totalCost_;
4901     }
4902     /**
4903      *
4904      *
4905      * <pre>
4906      * Deprecated: Use
4907      * [Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
4908      * instead. Total cost of the solution. This takes into account all costs:
4909      * costs per per hour and travel hour, fixed vehicle costs, unperformed
4910      * shipment penalty costs, global duration cost, etc.
4911      * </pre>
4912      *
4913      * <code>double total_cost = 2 [deprecated = true];</code>
4914      *
4915      * @deprecated google.cloud.optimization.v1.OptimizeToursResponse.total_cost is deprecated. See
4916      *     google/cloud/optimization/v1/fleet_routing.proto;l=425
4917      * @param value The totalCost to set.
4918      * @return This builder for chaining.
4919      */
4920     @java.lang.Deprecated
setTotalCost(double value)4921     public Builder setTotalCost(double value) {
4922 
4923       totalCost_ = value;
4924       bitField0_ |= 0x00000020;
4925       onChanged();
4926       return this;
4927     }
4928     /**
4929      *
4930      *
4931      * <pre>
4932      * Deprecated: Use
4933      * [Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost]
4934      * instead. Total cost of the solution. This takes into account all costs:
4935      * costs per per hour and travel hour, fixed vehicle costs, unperformed
4936      * shipment penalty costs, global duration cost, etc.
4937      * </pre>
4938      *
4939      * <code>double total_cost = 2 [deprecated = true];</code>
4940      *
4941      * @deprecated google.cloud.optimization.v1.OptimizeToursResponse.total_cost is deprecated. See
4942      *     google/cloud/optimization/v1/fleet_routing.proto;l=425
4943      * @return This builder for chaining.
4944      */
4945     @java.lang.Deprecated
clearTotalCost()4946     public Builder clearTotalCost() {
4947       bitField0_ = (bitField0_ & ~0x00000020);
4948       totalCost_ = 0D;
4949       onChanged();
4950       return this;
4951     }
4952 
4953     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)4954     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
4955       return super.setUnknownFields(unknownFields);
4956     }
4957 
4958     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4959     public final Builder mergeUnknownFields(
4960         final com.google.protobuf.UnknownFieldSet unknownFields) {
4961       return super.mergeUnknownFields(unknownFields);
4962     }
4963 
4964     // @@protoc_insertion_point(builder_scope:google.cloud.optimization.v1.OptimizeToursResponse)
4965   }
4966 
4967   // @@protoc_insertion_point(class_scope:google.cloud.optimization.v1.OptimizeToursResponse)
4968   private static final com.google.cloud.optimization.v1.OptimizeToursResponse DEFAULT_INSTANCE;
4969 
4970   static {
4971     DEFAULT_INSTANCE = new com.google.cloud.optimization.v1.OptimizeToursResponse();
4972   }
4973 
getDefaultInstance()4974   public static com.google.cloud.optimization.v1.OptimizeToursResponse getDefaultInstance() {
4975     return DEFAULT_INSTANCE;
4976   }
4977 
4978   private static final com.google.protobuf.Parser<OptimizeToursResponse> PARSER =
4979       new com.google.protobuf.AbstractParser<OptimizeToursResponse>() {
4980         @java.lang.Override
4981         public OptimizeToursResponse parsePartialFrom(
4982             com.google.protobuf.CodedInputStream input,
4983             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4984             throws com.google.protobuf.InvalidProtocolBufferException {
4985           Builder builder = newBuilder();
4986           try {
4987             builder.mergeFrom(input, extensionRegistry);
4988           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
4989             throw e.setUnfinishedMessage(builder.buildPartial());
4990           } catch (com.google.protobuf.UninitializedMessageException e) {
4991             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
4992           } catch (java.io.IOException e) {
4993             throw new com.google.protobuf.InvalidProtocolBufferException(e)
4994                 .setUnfinishedMessage(builder.buildPartial());
4995           }
4996           return builder.buildPartial();
4997         }
4998       };
4999 
parser()5000   public static com.google.protobuf.Parser<OptimizeToursResponse> parser() {
5001     return PARSER;
5002   }
5003 
5004   @java.lang.Override
getParserForType()5005   public com.google.protobuf.Parser<OptimizeToursResponse> getParserForType() {
5006     return PARSER;
5007   }
5008 
5009   @java.lang.Override
getDefaultInstanceForType()5010   public com.google.cloud.optimization.v1.OptimizeToursResponse getDefaultInstanceForType() {
5011     return DEFAULT_INSTANCE;
5012   }
5013 }
5014