# Class Shipment (1.91.0)

1.91.0 (latest) 1.89.0 1.86.0 1.85.0 1.83.0 1.81.0 1.80.0 1.78.0 1.76.0 1.74.0 1.73.0 1.72.0 1.71.0 1.70.0 1.68.0 1.66.0 1.65.0 1.62.0 1.61.0 1.60.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.10.0 1.9.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.14 0.1.2

    public final class Shipment extends GeneratedMessage implements ShipmentOrBuilder

The shipment of a single item, from one of its pickups to one of its
deliveries. For the shipment to be considered as performed, a unique vehicle
must visit one of its pickup locations (and decrease its spare capacities
accordingly), then visit one of its delivery locations later on (and
therefore re-increase its spare capacities accordingly).

Protobuf type `google.cloud.optimization.v1.Shipment`

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [AbstractMessageLite\<MessageType,BuilderType\>](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html) \> [AbstractMessage](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html) \> [GeneratedMessage](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html) \> Shipment

## Implements

[ShipmentOrBuilder](https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.ShipmentOrBuilder)

## Inherited Members

[AbstractMessage.equals(Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_equals_java_lang_Object_) [AbstractMessage.findInitializationErrors()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_findInitializationErrors__) [AbstractMessage.getInitializationErrorString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_getInitializationErrorString__) [AbstractMessage.hashCode()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_hashCode__) [AbstractMessage.hashFields(int,Map\<Descriptors.FieldDescriptor,Object\>)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_hashFields_int_java_util_Map_com_google_protobuf_Descriptors_FieldDescriptor_java_lang_Object__) [AbstractMessage.newBuilderForType(AbstractMessage.BuilderParent)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_newBuilderForType_com_google_protobuf_AbstractMessage_BuilderParent_) [AbstractMessage.toString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_toString__) [AbstractMessageLite.\<T\>addAll(Iterable\<T\>,List\<? super T\>)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html#com_google_protobuf_AbstractMessageLite__T_addAll_java_lang_Iterable_T__java_util_List___super_T__) [AbstractMessageLite.checkByteStringIsUtf8(ByteString)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html#com_google_protobuf_AbstractMessageLite_checkByteStringIsUtf8_com_google_protobuf_ByteString_) [AbstractMessageLite.toByteArray()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html#com_google_protobuf_AbstractMessageLite_toByteArray__) [AbstractMessageLite.toByteString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html#com_google_protobuf_AbstractMessageLite_toByteString__) [AbstractMessageLite.writeDelimitedTo(OutputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html#com_google_protobuf_AbstractMessageLite_writeDelimitedTo_java_io_OutputStream_) [AbstractMessageLite.writeTo(OutputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.html#com_google_protobuf_AbstractMessageLite_writeTo_java_io_OutputStream_) com.google.protobuf.GeneratedMessage.\<ContainingT,T\>newFileScopedGeneratedExtension(java.lang.Class\<?\>,com.google.protobuf.Message) com.google.protobuf.GeneratedMessage.\<ContainingT,T\>newMessageScopedGeneratedExtension(com.google.protobuf.Message,int,java.lang.Class\<?\>,com.google.protobuf.Message) com.google.protobuf.GeneratedMessage.\<ListT\>makeMutableCopy(ListT) com.google.protobuf.GeneratedMessage.\<ListT\>makeMutableCopy(ListT,int) [GeneratedMessage.\<M\>parseDelimitedWithIOException(Parser\<M\>,InputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage__M_parseDelimitedWithIOException_com_google_protobuf_Parser_M__java_io_InputStream_) [GeneratedMessage.\<M\>parseDelimitedWithIOException(Parser\<M\>,InputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage__M_parseDelimitedWithIOException_com_google_protobuf_Parser_M__java_io_InputStream_com_google_protobuf_ExtensionRegistryLite_) [GeneratedMessage.\<M\>parseWithIOException(Parser\<M\>,CodedInputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage__M_parseWithIOException_com_google_protobuf_Parser_M__com_google_protobuf_CodedInputStream_) [GeneratedMessage.\<M\>parseWithIOException(Parser\<M\>,CodedInputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage__M_parseWithIOException_com_google_protobuf_Parser_M__com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_) [GeneratedMessage.\<M\>parseWithIOException(Parser\<M\>,InputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage__M_parseWithIOException_com_google_protobuf_Parser_M__java_io_InputStream_) [GeneratedMessage.\<M\>parseWithIOException(Parser\<M\>,InputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage__M_parseWithIOException_com_google_protobuf_Parser_M__java_io_InputStream_com_google_protobuf_ExtensionRegistryLite_) com.google.protobuf.GeneratedMessage.\<T\>emptyList(java.lang.Class\<T\>) com.google.protobuf.GeneratedMessage.\<V\>serializeBooleanMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField\<java.lang.Boolean,V\>,com.google.protobuf.MapEntry\<java.lang.Boolean,V\>,int) com.google.protobuf.GeneratedMessage.\<V\>serializeIntegerMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField\<java.lang.Integer,V\>,com.google.protobuf.MapEntry\<java.lang.Integer,V\>,int) com.google.protobuf.GeneratedMessage.\<V\>serializeLongMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField\<java.lang.Long,V\>,com.google.protobuf.MapEntry\<java.lang.Long,V\>,int) com.google.protobuf.GeneratedMessage.\<V\>serializeStringMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField\<java.lang.String,V\>,com.google.protobuf.MapEntry\<java.lang.String,V\>,int) com.google.protobuf.GeneratedMessage.canUseUnsafe() [GeneratedMessage.computeStringSize(int,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_computeStringSize_int_java_lang_Object_) [GeneratedMessage.computeStringSizeNoTag(Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_computeStringSizeNoTag_java_lang_Object_) com.google.protobuf.GeneratedMessage.emptyBooleanList() com.google.protobuf.GeneratedMessage.emptyDoubleList() com.google.protobuf.GeneratedMessage.emptyFloatList() com.google.protobuf.GeneratedMessage.emptyIntList() com.google.protobuf.GeneratedMessage.emptyLongList() [GeneratedMessage.getAllFields()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getAllFields__) [GeneratedMessage.getDescriptorForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getDescriptorForType__) [GeneratedMessage.getField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.getOneofFieldDescriptor(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getOneofFieldDescriptor_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.getParserForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getParserForType__) [GeneratedMessage.getRepeatedField(Descriptors.FieldDescriptor,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_int_) [GeneratedMessage.getRepeatedFieldCount(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getRepeatedFieldCount_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.getSerializedSize()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getSerializedSize__) [GeneratedMessage.getUnknownFields()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getUnknownFields__) [GeneratedMessage.hasField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_hasField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.hasOneof(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_hasOneof_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.internalGetFieldAccessorTable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_internalGetFieldAccessorTable__) [GeneratedMessage.internalGetMapField(int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_internalGetMapField_int_) com.google.protobuf.GeneratedMessage.internalGetMapFieldReflection(int) [GeneratedMessage.isInitialized()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_isInitialized__) com.google.protobuf.GeneratedMessage.isStringEmpty(java.lang.Object) [GeneratedMessage.makeExtensionsImmutable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_makeExtensionsImmutable__) com.google.protobuf.GeneratedMessage.mergeFromAndMakeImmutableInternal(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite) com.google.protobuf.GeneratedMessage.newInstance(com.google.protobuf.GeneratedMessage.UnusedPrivateParameter) [GeneratedMessage.parseUnknownField(CodedInputStream,UnknownFieldSet.Builder,ExtensionRegistryLite,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_parseUnknownField_com_google_protobuf_CodedInputStream_com_google_protobuf_UnknownFieldSet_Builder_com_google_protobuf_ExtensionRegistryLite_int_) com.google.protobuf.GeneratedMessage.parseUnknownFieldProto3(com.google.protobuf.CodedInputStream,com.google.protobuf.UnknownFieldSet.Builder,com.google.protobuf.ExtensionRegistryLite,int) [GeneratedMessage.writeReplace()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_writeReplace__) [GeneratedMessage.writeString(CodedOutputStream,int,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_writeString_com_google_protobuf_CodedOutputStream_int_java_lang_Object_) [GeneratedMessage.writeStringNoTag(CodedOutputStream,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_writeStringNoTag_com_google_protobuf_CodedOutputStream_java_lang_Object_) [GeneratedMessage.writeTo(CodedOutputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_writeTo_com_google_protobuf_CodedOutputStream_) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### ALLOWED_VEHICLE_INDICES_FIELD_NUMBER

    public static final int ALLOWED_VEHICLE_INDICES_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### COSTS_PER_VEHICLE_FIELD_NUMBER

    public static final int COSTS_PER_VEHICLE_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### COSTS_PER_VEHICLE_INDICES_FIELD_NUMBER

    public static final int COSTS_PER_VEHICLE_INDICES_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### DELIVERIES_FIELD_NUMBER

    public static final int DELIVERIES_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### DEMANDS_FIELD_NUMBER

    public static final int DEMANDS_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### IGNORE_FIELD_NUMBER

    public static final int IGNORE_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### LABEL_FIELD_NUMBER

    public static final int LABEL_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### LOAD_DEMANDS_FIELD_NUMBER

    public static final int LOAD_DEMANDS_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### PENALTY_COST_FIELD_NUMBER

    public static final int PENALTY_COST_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### PICKUPS_FIELD_NUMBER

    public static final int PICKUPS_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### PICKUP_TO_DELIVERY_ABSOLUTE_DETOUR_LIMIT_FIELD_NUMBER

    public static final int PICKUP_TO_DELIVERY_ABSOLUTE_DETOUR_LIMIT_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### PICKUP_TO_DELIVERY_RELATIVE_DETOUR_LIMIT_FIELD_NUMBER

    public static final int PICKUP_TO_DELIVERY_RELATIVE_DETOUR_LIMIT_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### PICKUP_TO_DELIVERY_TIME_LIMIT_FIELD_NUMBER

    public static final int PICKUP_TO_DELIVERY_TIME_LIMIT_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### SHIPMENT_TYPE_FIELD_NUMBER

    public static final int SHIPMENT_TYPE_FIELD_NUMBER

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

## Static Methods

### getDefaultInstance()

    public static Shipment getDefaultInstance()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

### getDescriptor()

    public static final Descriptors.Descriptor getDescriptor()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.Descriptor.html` |   |

### newBuilder()

    public static Shipment.Builder newBuilder()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Builder` |   |

### newBuilder(Shipment prototype)

    public static Shipment.Builder newBuilder(Shipment prototype)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `prototype` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Builder` |   |

### parseDelimitedFrom(InputStream input)

    public static Shipment parseDelimitedFrom(InputStream input)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

    public static Shipment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### parseFrom(byte\[\] data)

    public static Shipment parseFrom(byte[] data)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `byte[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.InvalidProtocolBufferException.html` |   |

### parseFrom(byte\[\] data, ExtensionRegistryLite extensionRegistry)

    public static Shipment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `byte[]` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.InvalidProtocolBufferException.html` |   |

### parseFrom(ByteString data)

    public static Shipment parseFrom(ByteString data)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.InvalidProtocolBufferException.html` |   |

### parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

    public static Shipment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.InvalidProtocolBufferException.html` |   |

### parseFrom(CodedInputStream input)

    public static Shipment parseFrom(CodedInputStream input)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedInputStream.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

    public static Shipment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedInputStream.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### parseFrom(InputStream input)

    public static Shipment parseFrom(InputStream input)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

    public static Shipment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### parseFrom(ByteBuffer data)

    public static Shipment parseFrom(ByteBuffer data)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.InvalidProtocolBufferException.html` |   |

### parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

    public static Shipment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.InvalidProtocolBufferException.html` |   |

### parser()

    public static Parser<Shipment> parser()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Parser.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment>` |   |

## Methods

### containsLoadDemands(String key)

    public boolean containsLoadDemands(String key)

Load demands of the shipment (for example weight, volume, number of
pallets etc). The keys in the map should be identifiers describing the type
of the corresponding load, ideally also including the units.
For example: "weight_kg", "volume_gallons", "pallet_count", etc.
If a given key does not appear in the map, the corresponding load is
considered as null.

`map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### equals(Object obj)

    public boolean equals(Object obj)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `obj` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [AbstractMessage.equals(Object other)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_equals_java_lang_Object_)

### getAllowedVehicleIndices(int index)

    public int getAllowedVehicleIndices(int index)

The set of vehicles that may perform this shipment. If empty, all vehicles
may perform it. Vehicles are given by their index in the `ShipmentModel`'s
`vehicles` list.

`repeated int32 allowed_vehicle_indices = 5;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The allowedVehicleIndices at the given index. |

### getAllowedVehicleIndicesCount()

    public int getAllowedVehicleIndicesCount()

The set of vehicles that may perform this shipment. If empty, all vehicles
may perform it. Vehicles are given by their index in the `ShipmentModel`'s
`vehicles` list.

`repeated int32 allowed_vehicle_indices = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of allowedVehicleIndices. |

### getAllowedVehicleIndicesList()

    public List<Integer> getAllowedVehicleIndicesList()

The set of vehicles that may perform this shipment. If empty, all vehicles
may perform it. Vehicles are given by their index in the `ShipmentModel`'s
`vehicles` list.

`repeated int32 allowed_vehicle_indices = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html>` | A list containing the allowedVehicleIndices. |

### getCostsPerVehicle(int index)

    public double getCostsPerVehicle(int index)

Specifies the cost that is incurred when this shipment is delivered by each
vehicle. If specified, it must have EITHER:

- the same number of elements as `costs_per_vehicle_indices`. `costs_per_vehicle[i]` corresponds to vehicle `costs_per_vehicle_indices[i]` of the model.
- the same number of elements as there are vehicles in the model. The
  i-th element corresponds to vehicle #i of the model.

  These costs must be in the same unit as `penalty_cost` and must not be
  negative. Leave this field empty, if there are no such costs.

`repeated double costs_per_vehicle = 6;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The costsPerVehicle at the given index. |

### getCostsPerVehicleCount()

    public int getCostsPerVehicleCount()

Specifies the cost that is incurred when this shipment is delivered by each
vehicle. If specified, it must have EITHER:

- the same number of elements as `costs_per_vehicle_indices`. `costs_per_vehicle[i]` corresponds to vehicle `costs_per_vehicle_indices[i]` of the model.
- the same number of elements as there are vehicles in the model. The
  i-th element corresponds to vehicle #i of the model.

  These costs must be in the same unit as `penalty_cost` and must not be
  negative. Leave this field empty, if there are no such costs.

`repeated double costs_per_vehicle = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of costsPerVehicle. |

### getCostsPerVehicleIndices(int index)

    public int getCostsPerVehicleIndices(int index)

Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
it must have the same number of elements as `costs_per_vehicle`. A vehicle
index may not be specified more than once. If a vehicle is excluded from
`costs_per_vehicle_indices`, its cost is zero.

`repeated int32 costs_per_vehicle_indices = 7;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The costsPerVehicleIndices at the given index. |

### getCostsPerVehicleIndicesCount()

    public int getCostsPerVehicleIndicesCount()

Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
it must have the same number of elements as `costs_per_vehicle`. A vehicle
index may not be specified more than once. If a vehicle is excluded from
`costs_per_vehicle_indices`, its cost is zero.

`repeated int32 costs_per_vehicle_indices = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of costsPerVehicleIndices. |

### getCostsPerVehicleIndicesList()

    public List<Integer> getCostsPerVehicleIndicesList()

Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
it must have the same number of elements as `costs_per_vehicle`. A vehicle
index may not be specified more than once. If a vehicle is excluded from
`costs_per_vehicle_indices`, its cost is zero.

`repeated int32 costs_per_vehicle_indices = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html>` | A list containing the costsPerVehicleIndices. |

### getCostsPerVehicleList()

    public List<Double> getCostsPerVehicleList()

Specifies the cost that is incurred when this shipment is delivered by each
vehicle. If specified, it must have EITHER:

- the same number of elements as `costs_per_vehicle_indices`. `costs_per_vehicle[i]` corresponds to vehicle `costs_per_vehicle_indices[i]` of the model.
- the same number of elements as there are vehicles in the model. The
  i-th element corresponds to vehicle #i of the model.

  These costs must be in the same unit as `penalty_cost` and must not be
  negative. Leave this field empty, if there are no such costs.

`repeated double costs_per_vehicle = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html>` | A list containing the costsPerVehicle. |

### getDefaultInstanceForType()

    public Shipment getDefaultInstanceForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment` |   |

### getDeliveries(int index)

    public Shipment.VisitRequest getDeliveries(int index)

Set of delivery alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the pickups.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.VisitRequest` |   |

### getDeliveriesCount()

    public int getDeliveriesCount()

Set of delivery alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the pickups.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getDeliveriesList()

    public List<Shipment.VisitRequest> getDeliveriesList()

Set of delivery alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the pickups.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.VisitRequest>` |   |

### getDeliveriesOrBuilder(int index)

    public Shipment.VisitRequestOrBuilder getDeliveriesOrBuilder(int index)

Set of delivery alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the pickups.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.VisitRequestOrBuilder` |   |

### getDeliveriesOrBuilderList()

    public List<? extends Shipment.VisitRequestOrBuilder> getDeliveriesOrBuilderList()

Set of delivery alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the pickups.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest deliveries = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.optimization.v1.Shipment.VisitRequestOrBuilder>` |   |

### getDemands(int index) (deprecated)

    public CapacityQuantity getDemands(int index)

Deprecated: Use
Shipment.load_demands
instead.

`repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantity` |   |

### getDemandsCount() (deprecated)

    public int getDemandsCount()

Deprecated: Use
Shipment.load_demands
instead.

`repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getDemandsList() (deprecated)

    public List<CapacityQuantity> getDemandsList()

Deprecated: Use
Shipment.load_demands
instead.

`repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantity>` |   |

### getDemandsOrBuilder(int index) (deprecated)

    public CapacityQuantityOrBuilder getDemandsOrBuilder(int index)

Deprecated: Use
Shipment.load_demands
instead.

`repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantityOrBuilder` |   |

### getDemandsOrBuilderList() (deprecated)

    public List<? extends CapacityQuantityOrBuilder> getDemandsOrBuilderList()

Deprecated: Use
Shipment.load_demands
instead.

`repeated .google.cloud.optimization.v1.CapacityQuantity demands = 3 [deprecated = true];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.optimization.v1.CapacityQuantityOrBuilder>` |   |

### getIgnore()

    public boolean getIgnore()

If true, skip this shipment, but don't apply a `penalty_cost`.

Ignoring a shipment results in a validation error when there are any
`shipment_type_requirements` in the model.

Ignoring a shipment that is performed in `injected_first_solution_routes`
or `injected_solution_constraint` is permitted; the solver removes the
related pickup/delivery visits from the performing route.
`precedence_rules` that reference ignored shipments will also be ignored.

`bool ignore = 13;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The ignore. |

### getLabel()

    public String getLabel()

Specifies a label for this shipment. This label is reported in the response
in the `shipment_label` of the corresponding
ShipmentRoute.Visit.

`string label = 12;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The label. |

### getLabelBytes()

    public ByteString getLabelBytes()

Specifies a label for this shipment. This label is reported in the response
in the `shipment_label` of the corresponding
ShipmentRoute.Visit.

`string label = 12;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for label. |

### getLoadDemands() (deprecated)

    public Map<String,Shipment.Load> getLoadDemands()

Use [#getLoadDemandsMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment#com_google_cloud_optimization_v1_Shipment_getLoadDemandsMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load>` |   |

### getLoadDemandsCount()

    public int getLoadDemandsCount()

Load demands of the shipment (for example weight, volume, number of
pallets etc). The keys in the map should be identifiers describing the type
of the corresponding load, ideally also including the units.
For example: "weight_kg", "volume_gallons", "pallet_count", etc.
If a given key does not appear in the map, the corresponding load is
considered as null.

`map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getLoadDemandsMap()

    public Map<String,Shipment.Load> getLoadDemandsMap()

Load demands of the shipment (for example weight, volume, number of
pallets etc). The keys in the map should be identifiers describing the type
of the corresponding load, ideally also including the units.
For example: "weight_kg", "volume_gallons", "pallet_count", etc.
If a given key does not appear in the map, the corresponding load is
considered as null.

`map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load>` |   |

### getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

    public Shipment.Load getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

Load demands of the shipment (for example weight, volume, number of
pallets etc). The keys in the map should be identifiers describing the type
of the corresponding load, ideally also including the units.
For example: "weight_kg", "volume_gallons", "pallet_count", etc.
If a given key does not appear in the map, the corresponding load is
considered as null.

`map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load` |   |

### getLoadDemandsOrThrow(String key)

    public Shipment.Load getLoadDemandsOrThrow(String key)

Load demands of the shipment (for example weight, volume, number of
pallets etc). The keys in the map should be identifiers describing the type
of the corresponding load, ideally also including the units.
For example: "weight_kg", "volume_gallons", "pallet_count", etc.
If a given key does not appear in the map, the corresponding load is
considered as null.

`map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 14;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load` |   |

### getParserForType()

    public Parser<Shipment> getParserForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Parser.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment>` |   |

**Overrides** [GeneratedMessage.getParserForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getParserForType__)

### getPenaltyCost()

    public double getPenaltyCost()

If the shipment is not completed, this penalty is added to the overall
cost of the routes. A shipment is considered completed if one of its pickup
and delivery alternatives is visited. The cost may be expressed in the
same unit used for all other cost-related fields in the model and must be
positive.

*IMPORTANT*: If this penalty is not specified, it is considered infinite,
i.e. the shipment must be completed.

`optional double penalty_cost = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The penaltyCost. |

### getPickupToDeliveryAbsoluteDetourLimit()

    public Duration getPickupToDeliveryAbsoluteDetourLimit()

Specifies the maximum absolute detour time compared to the shortest path
from pickup to delivery. If specified, it must be nonnegative, and the
shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected
pickup alternative directly to the selected delivery alternative. Then
setting `pickup_to_delivery_absolute_detour_limit` enforces:

`<code><code>
start_time(delivery) - start_time(pickup) &lt;=
t + pickup_to_delivery_absolute_detour_limit
</code></code>`

If both relative and absolute limits are specified on the same shipment,
the more constraining limit is used for each possible pickup/delivery pair.
As of 2017/10, detours are only supported when travel durations do not
depend on vehicles.

`.google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Duration.html` | The pickupToDeliveryAbsoluteDetourLimit. |

### getPickupToDeliveryAbsoluteDetourLimitOrBuilder()

    public DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder()

Specifies the maximum absolute detour time compared to the shortest path
from pickup to delivery. If specified, it must be nonnegative, and the
shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected
pickup alternative directly to the selected delivery alternative. Then
setting `pickup_to_delivery_absolute_detour_limit` enforces:

`<code><code>
start_time(delivery) - start_time(pickup) &lt;=
t + pickup_to_delivery_absolute_detour_limit
</code></code>`

If both relative and absolute limits are specified on the same shipment,
the more constraining limit is used for each possible pickup/delivery pair.
As of 2017/10, detours are only supported when travel durations do not
depend on vehicles.

`.google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.DurationOrBuilder.html` |   |

### getPickupToDeliveryRelativeDetourLimit()

    public double getPickupToDeliveryRelativeDetourLimit()

Specifies the maximum relative detour time compared to the shortest path
from pickup to delivery. If specified, it must be nonnegative, and the
shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected
pickup alternative directly to the selected delivery alternative. Then
setting `pickup_to_delivery_relative_detour_limit` enforces:

`<code><code>
start_time(delivery) - start_time(pickup) &lt;=
std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
</code></code>`

If both relative and absolute limits are specified on the same shipment,
the more constraining limit is used for each possible pickup/delivery pair.
As of 2017/10, detours are only supported when travel durations do not
depend on vehicles.

`optional double pickup_to_delivery_relative_detour_limit = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The pickupToDeliveryRelativeDetourLimit. |

### getPickupToDeliveryTimeLimit()

    public Duration getPickupToDeliveryTimeLimit()

Specifies the maximum duration from start of pickup to start of delivery of
a shipment. If specified, it must be nonnegative, and the shipment must
contain at least a pickup and a delivery. This does not depend on which
alternatives are selected for pickup and delivery, nor on vehicle speed.
This can be specified alongside maximum detour constraints: the solution
will respect both specifications.

`.google.protobuf.Duration pickup_to_delivery_time_limit = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Duration.html` | The pickupToDeliveryTimeLimit. |

### getPickupToDeliveryTimeLimitOrBuilder()

    public DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder()

Specifies the maximum duration from start of pickup to start of delivery of
a shipment. If specified, it must be nonnegative, and the shipment must
contain at least a pickup and a delivery. This does not depend on which
alternatives are selected for pickup and delivery, nor on vehicle speed.
This can be specified alongside maximum detour constraints: the solution
will respect both specifications.

`.google.protobuf.Duration pickup_to_delivery_time_limit = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.DurationOrBuilder.html` |   |

### getPickups(int index)

    public Shipment.VisitRequest getPickups(int index)

Set of pickup alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the deliveries.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.VisitRequest` |   |

### getPickupsCount()

    public int getPickupsCount()

Set of pickup alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the deliveries.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getPickupsList()

    public List<Shipment.VisitRequest> getPickupsList()

Set of pickup alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the deliveries.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.VisitRequest>` |   |

### getPickupsOrBuilder(int index)

    public Shipment.VisitRequestOrBuilder getPickupsOrBuilder(int index)

Set of pickup alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the deliveries.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.VisitRequestOrBuilder` |   |

### getPickupsOrBuilderList()

    public List<? extends Shipment.VisitRequestOrBuilder> getPickupsOrBuilderList()

Set of pickup alternatives associated to the shipment. If not specified,
the vehicle only needs to visit a location corresponding to the deliveries.

`repeated .google.cloud.optimization.v1.Shipment.VisitRequest pickups = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.optimization.v1.Shipment.VisitRequestOrBuilder>` |   |

### getSerializedSize()

    public int getSerializedSize()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [GeneratedMessage.getSerializedSize()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_getSerializedSize__)

### getShipmentType()

    public String getShipmentType()

Non-empty string specifying a "type" for this shipment.
This feature can be used to define incompatibilities or requirements
between `shipment_types` (see `shipment_type_incompatibilities` and
`shipment_type_requirements` in `ShipmentModel`).

Differs from `visit_types` which is specified for a single visit: All
pickup/deliveries belonging to the same shipment share the same
`shipment_type`.

`string shipment_type = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The shipmentType. |

### getShipmentTypeBytes()

    public ByteString getShipmentTypeBytes()

Non-empty string specifying a "type" for this shipment.
This feature can be used to define incompatibilities or requirements
between `shipment_types` (see `shipment_type_incompatibilities` and
`shipment_type_requirements` in `ShipmentModel`).

Differs from `visit_types` which is specified for a single visit: All
pickup/deliveries belonging to the same shipment share the same
`shipment_type`.

`string shipment_type = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for shipmentType. |

### hasPenaltyCost()

    public boolean hasPenaltyCost()

If the shipment is not completed, this penalty is added to the overall
cost of the routes. A shipment is considered completed if one of its pickup
and delivery alternatives is visited. The cost may be expressed in the
same unit used for all other cost-related fields in the model and must be
positive.

*IMPORTANT*: If this penalty is not specified, it is considered infinite,
i.e. the shipment must be completed.

`optional double penalty_cost = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the penaltyCost field is set. |

### hasPickupToDeliveryAbsoluteDetourLimit()

    public boolean hasPickupToDeliveryAbsoluteDetourLimit()

Specifies the maximum absolute detour time compared to the shortest path
from pickup to delivery. If specified, it must be nonnegative, and the
shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected
pickup alternative directly to the selected delivery alternative. Then
setting `pickup_to_delivery_absolute_detour_limit` enforces:

`<code><code>
start_time(delivery) - start_time(pickup) &lt;=
t + pickup_to_delivery_absolute_detour_limit
</code></code>`

If both relative and absolute limits are specified on the same shipment,
the more constraining limit is used for each possible pickup/delivery pair.
As of 2017/10, detours are only supported when travel durations do not
depend on vehicles.

`.google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the pickupToDeliveryAbsoluteDetourLimit field is set. |

### hasPickupToDeliveryRelativeDetourLimit()

    public boolean hasPickupToDeliveryRelativeDetourLimit()

Specifies the maximum relative detour time compared to the shortest path
from pickup to delivery. If specified, it must be nonnegative, and the
shipment must contain at least a pickup and a delivery.

For example, let t be the shortest time taken to go from the selected
pickup alternative directly to the selected delivery alternative. Then
setting `pickup_to_delivery_relative_detour_limit` enforces:

`<code><code>
start_time(delivery) - start_time(pickup) &lt;=
std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
</code></code>`

If both relative and absolute limits are specified on the same shipment,
the more constraining limit is used for each possible pickup/delivery pair.
As of 2017/10, detours are only supported when travel durations do not
depend on vehicles.

`optional double pickup_to_delivery_relative_detour_limit = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the pickupToDeliveryRelativeDetourLimit field is set. |

### hasPickupToDeliveryTimeLimit()

    public boolean hasPickupToDeliveryTimeLimit()

Specifies the maximum duration from start of pickup to start of delivery of
a shipment. If specified, it must be nonnegative, and the shipment must
contain at least a pickup and a delivery. This does not depend on which
alternatives are selected for pickup and delivery, nor on vehicle speed.
This can be specified alongside maximum detour constraints: the solution
will respect both specifications.

`.google.protobuf.Duration pickup_to_delivery_time_limit = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the pickupToDeliveryTimeLimit field is set. |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [AbstractMessage.hashCode()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_hashCode__)

### internalGetFieldAccessorTable()

    protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.FieldAccessorTable.html` |   |

**Overrides** [GeneratedMessage.internalGetFieldAccessorTable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_internalGetFieldAccessorTable__)

### internalGetMapFieldReflection(int number)

    protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `number` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.protobuf.MapFieldReflectionAccessor` |   |

**Overrides** com.google.protobuf.GeneratedMessage.internalGetMapFieldReflection(int)

### isInitialized()

    public final boolean isInitialized()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [GeneratedMessage.isInitialized()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_isInitialized__)

### newBuilderForType()

    public Shipment.Builder newBuilderForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Builder` |   |

### newBuilderForType(AbstractMessage.BuilderParent parent)

    protected Shipment.Builder newBuilderForType(AbstractMessage.BuilderParent parent)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.BuilderParent.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Builder` |   |

**Overrides** [AbstractMessage.newBuilderForType(AbstractMessage.BuilderParent parent)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.html#com_google_protobuf_AbstractMessage_newBuilderForType_com_google_protobuf_AbstractMessage_BuilderParent_)

### toBuilder()

    public Shipment.Builder toBuilder()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Builder` |   |

### writeTo(CodedOutputStream output)

    public void writeTo(CodedOutputStream output)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `output` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedOutputStream.html` |

**Overrides** [GeneratedMessage.writeTo(CodedOutputStream output)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.html#com_google_protobuf_GeneratedMessage_writeTo_com_google_protobuf_CodedOutputStream_)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |