All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.maps.routeoptimization.v1.TimeWindow Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/maps/routeoptimization/v1/route_optimization_service.proto

// Protobuf Java Version: 3.25.5
package com.google.maps.routeoptimization.v1;

/**
 *
 *
 * 
 * Time windows constrain the time of an event, such as the arrival time at a
 * visit, or the start and end time of a vehicle.
 *
 * Hard time window bounds, `start_time` and `end_time`, enforce the earliest
 * and latest time of the event, such that `start_time <= event_time <=
 * end_time`. The soft time window lower bound, `soft_start_time`, expresses a
 * preference for the event to happen at or after `soft_start_time` by incurring
 * a cost proportional to how long before soft_start_time the event occurs. The
 * soft time window upper bound, `soft_end_time`, expresses a preference for the
 * event to happen at or before `soft_end_time` by incurring a cost proportional
 * to how long after `soft_end_time` the event occurs. `start_time`, `end_time`,
 * `soft_start_time` and `soft_end_time` should be within the global time limits
 * (see
 * [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
 * and
 * [ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time])
 * and should respect:
 * ```
 *   0 <= `start_time` <= `end_time` and
 *   0 <= `start_time` <= `soft_start_time` and
 *   0 <= `soft_end_time` <= `end_time`.
 * ```
 * 
* * Protobuf type {@code google.maps.routeoptimization.v1.TimeWindow} */ public final class TimeWindow extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.TimeWindow) TimeWindowOrBuilder { private static final long serialVersionUID = 0L; // Use TimeWindow.newBuilder() to construct. private TimeWindow(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private TimeWindow() {} @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new TimeWindow(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_TimeWindow_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.TimeWindow.class, com.google.maps.routeoptimization.v1.TimeWindow.Builder.class); } private int bitField0_; public static final int START_TIME_FIELD_NUMBER = 1; private com.google.protobuf.Timestamp startTime_; /** * * *
   * The hard time window start time. If unspecified it will be set to
   * `ShipmentModel.global_start_time`.
   * 
* * .google.protobuf.Timestamp start_time = 1; * * @return Whether the startTime field is set. */ @java.lang.Override public boolean hasStartTime() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * The hard time window start time. If unspecified it will be set to
   * `ShipmentModel.global_start_time`.
   * 
* * .google.protobuf.Timestamp start_time = 1; * * @return The startTime. */ @java.lang.Override public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } /** * * *
   * The hard time window start time. If unspecified it will be set to
   * `ShipmentModel.global_start_time`.
   * 
* * .google.protobuf.Timestamp start_time = 1; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 2; private com.google.protobuf.Timestamp endTime_; /** * * *
   * The hard time window end time. If unspecified it will be set to
   * `ShipmentModel.global_end_time`.
   * 
* * .google.protobuf.Timestamp end_time = 2; * * @return Whether the endTime field is set. */ @java.lang.Override public boolean hasEndTime() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
   * The hard time window end time. If unspecified it will be set to
   * `ShipmentModel.global_end_time`.
   * 
* * .google.protobuf.Timestamp end_time = 2; * * @return The endTime. */ @java.lang.Override public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } /** * * *
   * The hard time window end time. If unspecified it will be set to
   * `ShipmentModel.global_end_time`.
   * 
* * .google.protobuf.Timestamp end_time = 2; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } public static final int SOFT_START_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp softStartTime_; /** * * *
   * The soft start time of the time window.
   * 
* * .google.protobuf.Timestamp soft_start_time = 3; * * @return Whether the softStartTime field is set. */ @java.lang.Override public boolean hasSoftStartTime() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
   * The soft start time of the time window.
   * 
* * .google.protobuf.Timestamp soft_start_time = 3; * * @return The softStartTime. */ @java.lang.Override public com.google.protobuf.Timestamp getSoftStartTime() { return softStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softStartTime_; } /** * * *
   * The soft start time of the time window.
   * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getSoftStartTimeOrBuilder() { return softStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softStartTime_; } public static final int SOFT_END_TIME_FIELD_NUMBER = 4; private com.google.protobuf.Timestamp softEndTime_; /** * * *
   * The soft end time of the time window.
   * 
* * .google.protobuf.Timestamp soft_end_time = 4; * * @return Whether the softEndTime field is set. */ @java.lang.Override public boolean hasSoftEndTime() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
   * The soft end time of the time window.
   * 
* * .google.protobuf.Timestamp soft_end_time = 4; * * @return The softEndTime. */ @java.lang.Override public com.google.protobuf.Timestamp getSoftEndTime() { return softEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softEndTime_; } /** * * *
   * The soft end time of the time window.
   * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getSoftEndTimeOrBuilder() { return softEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softEndTime_; } public static final int COST_PER_HOUR_BEFORE_SOFT_START_TIME_FIELD_NUMBER = 5; private double costPerHourBeforeSoftStartTime_ = 0D; /** * * *
   * A cost per hour added to other costs in the model if the event occurs
   * before soft_start_time, computed as:
   *
   * ```
   *    max(0, soft_start_time - t.seconds)
   *                           * cost_per_hour_before_soft_start_time / 3600,
   * t being the time of the event.
   * ```
   *
   * This cost must be positive, and the field can only be set if
   * soft_start_time has been set.
   * 
* * optional double cost_per_hour_before_soft_start_time = 5; * * @return Whether the costPerHourBeforeSoftStartTime field is set. */ @java.lang.Override public boolean hasCostPerHourBeforeSoftStartTime() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
   * A cost per hour added to other costs in the model if the event occurs
   * before soft_start_time, computed as:
   *
   * ```
   *    max(0, soft_start_time - t.seconds)
   *                           * cost_per_hour_before_soft_start_time / 3600,
   * t being the time of the event.
   * ```
   *
   * This cost must be positive, and the field can only be set if
   * soft_start_time has been set.
   * 
* * optional double cost_per_hour_before_soft_start_time = 5; * * @return The costPerHourBeforeSoftStartTime. */ @java.lang.Override public double getCostPerHourBeforeSoftStartTime() { return costPerHourBeforeSoftStartTime_; } public static final int COST_PER_HOUR_AFTER_SOFT_END_TIME_FIELD_NUMBER = 6; private double costPerHourAfterSoftEndTime_ = 0D; /** * * *
   * A cost per hour added to other costs in the model if the event occurs after
   * `soft_end_time`, computed as:
   *
   * ```
   *    max(0, t.seconds - soft_end_time.seconds)
   *                     * cost_per_hour_after_soft_end_time / 3600,
   * t being the time of the event.
   * ```
   *
   * This cost must be positive, and the field can only be set if
   * `soft_end_time` has been set.
   * 
* * optional double cost_per_hour_after_soft_end_time = 6; * * @return Whether the costPerHourAfterSoftEndTime field is set. */ @java.lang.Override public boolean hasCostPerHourAfterSoftEndTime() { return ((bitField0_ & 0x00000020) != 0); } /** * * *
   * A cost per hour added to other costs in the model if the event occurs after
   * `soft_end_time`, computed as:
   *
   * ```
   *    max(0, t.seconds - soft_end_time.seconds)
   *                     * cost_per_hour_after_soft_end_time / 3600,
   * t being the time of the event.
   * ```
   *
   * This cost must be positive, and the field can only be set if
   * `soft_end_time` has been set.
   * 
* * optional double cost_per_hour_after_soft_end_time = 6; * * @return The costPerHourAfterSoftEndTime. */ @java.lang.Override public double getCostPerHourAfterSoftEndTime() { return costPerHourAfterSoftEndTime_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getStartTime()); } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getEndTime()); } if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(3, getSoftStartTime()); } if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(4, getSoftEndTime()); } if (((bitField0_ & 0x00000010) != 0)) { output.writeDouble(5, costPerHourBeforeSoftStartTime_); } if (((bitField0_ & 0x00000020) != 0)) { output.writeDouble(6, costPerHourAfterSoftEndTime_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSoftStartTime()); } if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSoftEndTime()); } if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize( 5, costPerHourBeforeSoftStartTime_); } if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, costPerHourAfterSoftEndTime_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.maps.routeoptimization.v1.TimeWindow)) { return super.equals(obj); } com.google.maps.routeoptimization.v1.TimeWindow other = (com.google.maps.routeoptimization.v1.TimeWindow) obj; if (hasStartTime() != other.hasStartTime()) return false; if (hasStartTime()) { if (!getStartTime().equals(other.getStartTime())) return false; } if (hasEndTime() != other.hasEndTime()) return false; if (hasEndTime()) { if (!getEndTime().equals(other.getEndTime())) return false; } if (hasSoftStartTime() != other.hasSoftStartTime()) return false; if (hasSoftStartTime()) { if (!getSoftStartTime().equals(other.getSoftStartTime())) return false; } if (hasSoftEndTime() != other.hasSoftEndTime()) return false; if (hasSoftEndTime()) { if (!getSoftEndTime().equals(other.getSoftEndTime())) return false; } if (hasCostPerHourBeforeSoftStartTime() != other.hasCostPerHourBeforeSoftStartTime()) return false; if (hasCostPerHourBeforeSoftStartTime()) { if (java.lang.Double.doubleToLongBits(getCostPerHourBeforeSoftStartTime()) != java.lang.Double.doubleToLongBits(other.getCostPerHourBeforeSoftStartTime())) return false; } if (hasCostPerHourAfterSoftEndTime() != other.hasCostPerHourAfterSoftEndTime()) return false; if (hasCostPerHourAfterSoftEndTime()) { if (java.lang.Double.doubleToLongBits(getCostPerHourAfterSoftEndTime()) != java.lang.Double.doubleToLongBits(other.getCostPerHourAfterSoftEndTime())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasStartTime()) { hash = (37 * hash) + START_TIME_FIELD_NUMBER; hash = (53 * hash) + getStartTime().hashCode(); } if (hasEndTime()) { hash = (37 * hash) + END_TIME_FIELD_NUMBER; hash = (53 * hash) + getEndTime().hashCode(); } if (hasSoftStartTime()) { hash = (37 * hash) + SOFT_START_TIME_FIELD_NUMBER; hash = (53 * hash) + getSoftStartTime().hashCode(); } if (hasSoftEndTime()) { hash = (37 * hash) + SOFT_END_TIME_FIELD_NUMBER; hash = (53 * hash) + getSoftEndTime().hashCode(); } if (hasCostPerHourBeforeSoftStartTime()) { hash = (37 * hash) + COST_PER_HOUR_BEFORE_SOFT_START_TIME_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getCostPerHourBeforeSoftStartTime())); } if (hasCostPerHourAfterSoftEndTime()) { hash = (37 * hash) + COST_PER_HOUR_AFTER_SOFT_END_TIME_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getCostPerHourAfterSoftEndTime())); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.maps.routeoptimization.v1.TimeWindow parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.TimeWindow parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.maps.routeoptimization.v1.TimeWindow prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * *
   * Time windows constrain the time of an event, such as the arrival time at a
   * visit, or the start and end time of a vehicle.
   *
   * Hard time window bounds, `start_time` and `end_time`, enforce the earliest
   * and latest time of the event, such that `start_time <= event_time <=
   * end_time`. The soft time window lower bound, `soft_start_time`, expresses a
   * preference for the event to happen at or after `soft_start_time` by incurring
   * a cost proportional to how long before soft_start_time the event occurs. The
   * soft time window upper bound, `soft_end_time`, expresses a preference for the
   * event to happen at or before `soft_end_time` by incurring a cost proportional
   * to how long after `soft_end_time` the event occurs. `start_time`, `end_time`,
   * `soft_start_time` and `soft_end_time` should be within the global time limits
   * (see
   * [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
   * and
   * [ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time])
   * and should respect:
   * ```
   *   0 <= `start_time` <= `end_time` and
   *   0 <= `start_time` <= `soft_start_time` and
   *   0 <= `soft_end_time` <= `end_time`.
   * ```
   * 
* * Protobuf type {@code google.maps.routeoptimization.v1.TimeWindow} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.TimeWindow) com.google.maps.routeoptimization.v1.TimeWindowOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_TimeWindow_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.TimeWindow.class, com.google.maps.routeoptimization.v1.TimeWindow.Builder.class); } // Construct using com.google.maps.routeoptimization.v1.TimeWindow.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getStartTimeFieldBuilder(); getEndTimeFieldBuilder(); getSoftStartTimeFieldBuilder(); getSoftEndTimeFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; startTime_ = null; if (startTimeBuilder_ != null) { startTimeBuilder_.dispose(); startTimeBuilder_ = null; } endTime_ = null; if (endTimeBuilder_ != null) { endTimeBuilder_.dispose(); endTimeBuilder_ = null; } softStartTime_ = null; if (softStartTimeBuilder_ != null) { softStartTimeBuilder_.dispose(); softStartTimeBuilder_ = null; } softEndTime_ = null; if (softEndTimeBuilder_ != null) { softEndTimeBuilder_.dispose(); softEndTimeBuilder_ = null; } costPerHourBeforeSoftStartTime_ = 0D; costPerHourAfterSoftEndTime_ = 0D; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor; } @java.lang.Override public com.google.maps.routeoptimization.v1.TimeWindow getDefaultInstanceForType() { return com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance(); } @java.lang.Override public com.google.maps.routeoptimization.v1.TimeWindow build() { com.google.maps.routeoptimization.v1.TimeWindow result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.maps.routeoptimization.v1.TimeWindow buildPartial() { com.google.maps.routeoptimization.v1.TimeWindow result = new com.google.maps.routeoptimization.v1.TimeWindow(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(com.google.maps.routeoptimization.v1.TimeWindow result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000002) != 0)) { result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000004) != 0)) { result.softStartTime_ = softStartTimeBuilder_ == null ? softStartTime_ : softStartTimeBuilder_.build(); to_bitField0_ |= 0x00000004; } if (((from_bitField0_ & 0x00000008) != 0)) { result.softEndTime_ = softEndTimeBuilder_ == null ? softEndTime_ : softEndTimeBuilder_.build(); to_bitField0_ |= 0x00000008; } if (((from_bitField0_ & 0x00000010) != 0)) { result.costPerHourBeforeSoftStartTime_ = costPerHourBeforeSoftStartTime_; to_bitField0_ |= 0x00000010; } if (((from_bitField0_ & 0x00000020) != 0)) { result.costPerHourAfterSoftEndTime_ = costPerHourAfterSoftEndTime_; to_bitField0_ |= 0x00000020; } result.bitField0_ |= to_bitField0_; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.maps.routeoptimization.v1.TimeWindow) { return mergeFrom((com.google.maps.routeoptimization.v1.TimeWindow) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.maps.routeoptimization.v1.TimeWindow other) { if (other == com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()) return this; if (other.hasStartTime()) { mergeStartTime(other.getStartTime()); } if (other.hasEndTime()) { mergeEndTime(other.getEndTime()); } if (other.hasSoftStartTime()) { mergeSoftStartTime(other.getSoftStartTime()); } if (other.hasSoftEndTime()) { mergeSoftEndTime(other.getSoftEndTime()); } if (other.hasCostPerHourBeforeSoftStartTime()) { setCostPerHourBeforeSoftStartTime(other.getCostPerHourBeforeSoftStartTime()); } if (other.hasCostPerHourAfterSoftEndTime()) { setCostPerHourAfterSoftEndTime(other.getCostPerHourAfterSoftEndTime()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000001; break; } // case 10 case 18: { input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000002; break; } // case 18 case 26: { input.readMessage(getSoftStartTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000004; break; } // case 26 case 34: { input.readMessage(getSoftEndTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000008; break; } // case 34 case 41: { costPerHourBeforeSoftStartTime_ = input.readDouble(); bitField0_ |= 0x00000010; break; } // case 41 case 49: { costPerHourAfterSoftEndTime_ = input.readDouble(); bitField0_ |= 0x00000020; break; } // case 49 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private com.google.protobuf.Timestamp startTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; * * @return Whether the startTime field is set. */ public boolean hasStartTime() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; * * @return The startTime. */ public com.google.protobuf.Timestamp getStartTime() { if (startTimeBuilder_ == null) { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } else { return startTimeBuilder_.getMessage(); } } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ public Builder setStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } startTime_ = value; } else { startTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && startTime_ != null && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } } else { startTimeBuilder_.mergeFrom(value); } if (startTime_ != null) { bitField0_ |= 0x00000001; onChanged(); } return this; } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ public Builder clearStartTime() { bitField0_ = (bitField0_ & ~0x00000001); startTime_ = null; if (startTimeBuilder_ != null) { startTimeBuilder_.dispose(); startTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { bitField0_ |= 0x00000001; onChanged(); return getStartTimeFieldBuilder().getBuilder(); } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { if (startTimeBuilder_ != null) { return startTimeBuilder_.getMessageOrBuilder(); } else { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } /** * * *
     * The hard time window start time. If unspecified it will be set to
     * `ShipmentModel.global_start_time`.
     * 
* * .google.protobuf.Timestamp start_time = 1; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getStartTime(), getParentForChildren(), isClean()); startTime_ = null; } return startTimeBuilder_; } private com.google.protobuf.Timestamp endTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; * * @return Whether the endTime field is set. */ public boolean hasEndTime() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; * * @return The endTime. */ public com.google.protobuf.Timestamp getEndTime() { if (endTimeBuilder_ == null) { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } else { return endTimeBuilder_.getMessage(); } } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ public Builder setEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } endTime_ = value; } else { endTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && endTime_ != null && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } } else { endTimeBuilder_.mergeFrom(value); } if (endTime_ != null) { bitField0_ |= 0x00000002; onChanged(); } return this; } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ public Builder clearEndTime() { bitField0_ = (bitField0_ & ~0x00000002); endTime_ = null; if (endTimeBuilder_ != null) { endTimeBuilder_.dispose(); endTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { bitField0_ |= 0x00000002; onChanged(); return getEndTimeFieldBuilder().getBuilder(); } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { if (endTimeBuilder_ != null) { return endTimeBuilder_.getMessageOrBuilder(); } else { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } /** * * *
     * The hard time window end time. If unspecified it will be set to
     * `ShipmentModel.global_end_time`.
     * 
* * .google.protobuf.Timestamp end_time = 2; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getEndTime(), getParentForChildren(), isClean()); endTime_ = null; } return endTimeBuilder_; } private com.google.protobuf.Timestamp softStartTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> softStartTimeBuilder_; /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; * * @return Whether the softStartTime field is set. */ public boolean hasSoftStartTime() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; * * @return The softStartTime. */ public com.google.protobuf.Timestamp getSoftStartTime() { if (softStartTimeBuilder_ == null) { return softStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softStartTime_; } else { return softStartTimeBuilder_.getMessage(); } } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ public Builder setSoftStartTime(com.google.protobuf.Timestamp value) { if (softStartTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } softStartTime_ = value; } else { softStartTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ public Builder setSoftStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (softStartTimeBuilder_ == null) { softStartTime_ = builderForValue.build(); } else { softStartTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ public Builder mergeSoftStartTime(com.google.protobuf.Timestamp value) { if (softStartTimeBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0) && softStartTime_ != null && softStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getSoftStartTimeBuilder().mergeFrom(value); } else { softStartTime_ = value; } } else { softStartTimeBuilder_.mergeFrom(value); } if (softStartTime_ != null) { bitField0_ |= 0x00000004; onChanged(); } return this; } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ public Builder clearSoftStartTime() { bitField0_ = (bitField0_ & ~0x00000004); softStartTime_ = null; if (softStartTimeBuilder_ != null) { softStartTimeBuilder_.dispose(); softStartTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ public com.google.protobuf.Timestamp.Builder getSoftStartTimeBuilder() { bitField0_ |= 0x00000004; onChanged(); return getSoftStartTimeFieldBuilder().getBuilder(); } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ public com.google.protobuf.TimestampOrBuilder getSoftStartTimeOrBuilder() { if (softStartTimeBuilder_ != null) { return softStartTimeBuilder_.getMessageOrBuilder(); } else { return softStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softStartTime_; } } /** * * *
     * The soft start time of the time window.
     * 
* * .google.protobuf.Timestamp soft_start_time = 3; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getSoftStartTimeFieldBuilder() { if (softStartTimeBuilder_ == null) { softStartTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getSoftStartTime(), getParentForChildren(), isClean()); softStartTime_ = null; } return softStartTimeBuilder_; } private com.google.protobuf.Timestamp softEndTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> softEndTimeBuilder_; /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; * * @return Whether the softEndTime field is set. */ public boolean hasSoftEndTime() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; * * @return The softEndTime. */ public com.google.protobuf.Timestamp getSoftEndTime() { if (softEndTimeBuilder_ == null) { return softEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softEndTime_; } else { return softEndTimeBuilder_.getMessage(); } } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ public Builder setSoftEndTime(com.google.protobuf.Timestamp value) { if (softEndTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } softEndTime_ = value; } else { softEndTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ public Builder setSoftEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (softEndTimeBuilder_ == null) { softEndTime_ = builderForValue.build(); } else { softEndTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ public Builder mergeSoftEndTime(com.google.protobuf.Timestamp value) { if (softEndTimeBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && softEndTime_ != null && softEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getSoftEndTimeBuilder().mergeFrom(value); } else { softEndTime_ = value; } } else { softEndTimeBuilder_.mergeFrom(value); } if (softEndTime_ != null) { bitField0_ |= 0x00000008; onChanged(); } return this; } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ public Builder clearSoftEndTime() { bitField0_ = (bitField0_ & ~0x00000008); softEndTime_ = null; if (softEndTimeBuilder_ != null) { softEndTimeBuilder_.dispose(); softEndTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ public com.google.protobuf.Timestamp.Builder getSoftEndTimeBuilder() { bitField0_ |= 0x00000008; onChanged(); return getSoftEndTimeFieldBuilder().getBuilder(); } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ public com.google.protobuf.TimestampOrBuilder getSoftEndTimeOrBuilder() { if (softEndTimeBuilder_ != null) { return softEndTimeBuilder_.getMessageOrBuilder(); } else { return softEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softEndTime_; } } /** * * *
     * The soft end time of the time window.
     * 
* * .google.protobuf.Timestamp soft_end_time = 4; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getSoftEndTimeFieldBuilder() { if (softEndTimeBuilder_ == null) { softEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getSoftEndTime(), getParentForChildren(), isClean()); softEndTime_ = null; } return softEndTimeBuilder_; } private double costPerHourBeforeSoftStartTime_; /** * * *
     * A cost per hour added to other costs in the model if the event occurs
     * before soft_start_time, computed as:
     *
     * ```
     *    max(0, soft_start_time - t.seconds)
     *                           * cost_per_hour_before_soft_start_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * soft_start_time has been set.
     * 
* * optional double cost_per_hour_before_soft_start_time = 5; * * @return Whether the costPerHourBeforeSoftStartTime field is set. */ @java.lang.Override public boolean hasCostPerHourBeforeSoftStartTime() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
     * A cost per hour added to other costs in the model if the event occurs
     * before soft_start_time, computed as:
     *
     * ```
     *    max(0, soft_start_time - t.seconds)
     *                           * cost_per_hour_before_soft_start_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * soft_start_time has been set.
     * 
* * optional double cost_per_hour_before_soft_start_time = 5; * * @return The costPerHourBeforeSoftStartTime. */ @java.lang.Override public double getCostPerHourBeforeSoftStartTime() { return costPerHourBeforeSoftStartTime_; } /** * * *
     * A cost per hour added to other costs in the model if the event occurs
     * before soft_start_time, computed as:
     *
     * ```
     *    max(0, soft_start_time - t.seconds)
     *                           * cost_per_hour_before_soft_start_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * soft_start_time has been set.
     * 
* * optional double cost_per_hour_before_soft_start_time = 5; * * @param value The costPerHourBeforeSoftStartTime to set. * @return This builder for chaining. */ public Builder setCostPerHourBeforeSoftStartTime(double value) { costPerHourBeforeSoftStartTime_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * A cost per hour added to other costs in the model if the event occurs
     * before soft_start_time, computed as:
     *
     * ```
     *    max(0, soft_start_time - t.seconds)
     *                           * cost_per_hour_before_soft_start_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * soft_start_time has been set.
     * 
* * optional double cost_per_hour_before_soft_start_time = 5; * * @return This builder for chaining. */ public Builder clearCostPerHourBeforeSoftStartTime() { bitField0_ = (bitField0_ & ~0x00000010); costPerHourBeforeSoftStartTime_ = 0D; onChanged(); return this; } private double costPerHourAfterSoftEndTime_; /** * * *
     * A cost per hour added to other costs in the model if the event occurs after
     * `soft_end_time`, computed as:
     *
     * ```
     *    max(0, t.seconds - soft_end_time.seconds)
     *                     * cost_per_hour_after_soft_end_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * `soft_end_time` has been set.
     * 
* * optional double cost_per_hour_after_soft_end_time = 6; * * @return Whether the costPerHourAfterSoftEndTime field is set. */ @java.lang.Override public boolean hasCostPerHourAfterSoftEndTime() { return ((bitField0_ & 0x00000020) != 0); } /** * * *
     * A cost per hour added to other costs in the model if the event occurs after
     * `soft_end_time`, computed as:
     *
     * ```
     *    max(0, t.seconds - soft_end_time.seconds)
     *                     * cost_per_hour_after_soft_end_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * `soft_end_time` has been set.
     * 
* * optional double cost_per_hour_after_soft_end_time = 6; * * @return The costPerHourAfterSoftEndTime. */ @java.lang.Override public double getCostPerHourAfterSoftEndTime() { return costPerHourAfterSoftEndTime_; } /** * * *
     * A cost per hour added to other costs in the model if the event occurs after
     * `soft_end_time`, computed as:
     *
     * ```
     *    max(0, t.seconds - soft_end_time.seconds)
     *                     * cost_per_hour_after_soft_end_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * `soft_end_time` has been set.
     * 
* * optional double cost_per_hour_after_soft_end_time = 6; * * @param value The costPerHourAfterSoftEndTime to set. * @return This builder for chaining. */ public Builder setCostPerHourAfterSoftEndTime(double value) { costPerHourAfterSoftEndTime_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } /** * * *
     * A cost per hour added to other costs in the model if the event occurs after
     * `soft_end_time`, computed as:
     *
     * ```
     *    max(0, t.seconds - soft_end_time.seconds)
     *                     * cost_per_hour_after_soft_end_time / 3600,
     * t being the time of the event.
     * ```
     *
     * This cost must be positive, and the field can only be set if
     * `soft_end_time` has been set.
     * 
* * optional double cost_per_hour_after_soft_end_time = 6; * * @return This builder for chaining. */ public Builder clearCostPerHourAfterSoftEndTime() { bitField0_ = (bitField0_ & ~0x00000020); costPerHourAfterSoftEndTime_ = 0D; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.TimeWindow) } // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.TimeWindow) private static final com.google.maps.routeoptimization.v1.TimeWindow DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.TimeWindow(); } public static com.google.maps.routeoptimization.v1.TimeWindow getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public TimeWindow parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.maps.routeoptimization.v1.TimeWindow getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy