Class ShipmentModel.PrecedenceRule.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ShipmentModel.PrecedenceRule.Builder>
com.google.cloud.optimization.v1.ShipmentModel.PrecedenceRule.Builder
All Implemented Interfaces:
ShipmentModel.PrecedenceRuleOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ShipmentModel.PrecedenceRule

public static final class ShipmentModel.PrecedenceRule.Builder extends com.google.protobuf.GeneratedMessage.Builder<ShipmentModel.PrecedenceRule.Builder> implements ShipmentModel.PrecedenceRuleOrBuilder
 A precedence rule between two events (each event is the pickup or the
 delivery of a shipment): the "second" event has to start at least
 `offset_duration` after "first" has started.

 Several precedences can refer to the same (or related) events, e.g.,
 "pickup of B happens after delivery of A" and "pickup of C happens after
 pickup of B".

 Furthermore, precedences only apply when both shipments are performed and
 are otherwise ignored.
 
Protobuf type google.cloud.optimization.v1.ShipmentModel.PrecedenceRule
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<ShipmentModel.PrecedenceRule.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<ShipmentModel.PrecedenceRule.Builder>
    • getDescriptorForType

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

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public ShipmentModel.PrecedenceRule buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public ShipmentModel.PrecedenceRule.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ShipmentModel.PrecedenceRule.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<ShipmentModel.PrecedenceRule.Builder>
    • mergeFrom

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

      public boolean hasFirstIndex()
       Shipment index of the "first" event. This field must be specified.
       
      optional int32 first_index = 1;
      Specified by:
      hasFirstIndex in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      Whether the firstIndex field is set.
    • getFirstIndex

      public int getFirstIndex()
       Shipment index of the "first" event. This field must be specified.
       
      optional int32 first_index = 1;
      Specified by:
      getFirstIndex in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      The firstIndex.
    • setFirstIndex

      public ShipmentModel.PrecedenceRule.Builder setFirstIndex(int value)
       Shipment index of the "first" event. This field must be specified.
       
      optional int32 first_index = 1;
      Parameters:
      value - The firstIndex to set.
      Returns:
      This builder for chaining.
    • clearFirstIndex

      public ShipmentModel.PrecedenceRule.Builder clearFirstIndex()
       Shipment index of the "first" event. This field must be specified.
       
      optional int32 first_index = 1;
      Returns:
      This builder for chaining.
    • getFirstIsDelivery

      public boolean getFirstIsDelivery()
       Indicates if the "first" event is a delivery.
       
      bool first_is_delivery = 3;
      Specified by:
      getFirstIsDelivery in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      The firstIsDelivery.
    • setFirstIsDelivery

      public ShipmentModel.PrecedenceRule.Builder setFirstIsDelivery(boolean value)
       Indicates if the "first" event is a delivery.
       
      bool first_is_delivery = 3;
      Parameters:
      value - The firstIsDelivery to set.
      Returns:
      This builder for chaining.
    • clearFirstIsDelivery

      public ShipmentModel.PrecedenceRule.Builder clearFirstIsDelivery()
       Indicates if the "first" event is a delivery.
       
      bool first_is_delivery = 3;
      Returns:
      This builder for chaining.
    • hasSecondIndex

      public boolean hasSecondIndex()
       Shipment index of the "second" event. This field must be specified.
       
      optional int32 second_index = 2;
      Specified by:
      hasSecondIndex in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      Whether the secondIndex field is set.
    • getSecondIndex

      public int getSecondIndex()
       Shipment index of the "second" event. This field must be specified.
       
      optional int32 second_index = 2;
      Specified by:
      getSecondIndex in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      The secondIndex.
    • setSecondIndex

      public ShipmentModel.PrecedenceRule.Builder setSecondIndex(int value)
       Shipment index of the "second" event. This field must be specified.
       
      optional int32 second_index = 2;
      Parameters:
      value - The secondIndex to set.
      Returns:
      This builder for chaining.
    • clearSecondIndex

      public ShipmentModel.PrecedenceRule.Builder clearSecondIndex()
       Shipment index of the "second" event. This field must be specified.
       
      optional int32 second_index = 2;
      Returns:
      This builder for chaining.
    • getSecondIsDelivery

      public boolean getSecondIsDelivery()
       Indicates if the "second" event is a delivery.
       
      bool second_is_delivery = 4;
      Specified by:
      getSecondIsDelivery in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      The secondIsDelivery.
    • setSecondIsDelivery

      public ShipmentModel.PrecedenceRule.Builder setSecondIsDelivery(boolean value)
       Indicates if the "second" event is a delivery.
       
      bool second_is_delivery = 4;
      Parameters:
      value - The secondIsDelivery to set.
      Returns:
      This builder for chaining.
    • clearSecondIsDelivery

      public ShipmentModel.PrecedenceRule.Builder clearSecondIsDelivery()
       Indicates if the "second" event is a delivery.
       
      bool second_is_delivery = 4;
      Returns:
      This builder for chaining.
    • hasOffsetDuration

      public boolean hasOffsetDuration()
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
      Specified by:
      hasOffsetDuration in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      Whether the offsetDuration field is set.
    • getOffsetDuration

      public com.google.protobuf.Duration getOffsetDuration()
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
      Specified by:
      getOffsetDuration in interface ShipmentModel.PrecedenceRuleOrBuilder
      Returns:
      The offsetDuration.
    • setOffsetDuration

      public ShipmentModel.PrecedenceRule.Builder setOffsetDuration(com.google.protobuf.Duration value)
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
    • setOffsetDuration

      public ShipmentModel.PrecedenceRule.Builder setOffsetDuration(com.google.protobuf.Duration.Builder builderForValue)
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
    • mergeOffsetDuration

      public ShipmentModel.PrecedenceRule.Builder mergeOffsetDuration(com.google.protobuf.Duration value)
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
    • clearOffsetDuration

      public ShipmentModel.PrecedenceRule.Builder clearOffsetDuration()
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
    • getOffsetDurationBuilder

      public com.google.protobuf.Duration.Builder getOffsetDurationBuilder()
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
    • getOffsetDurationOrBuilder

      public com.google.protobuf.DurationOrBuilder getOffsetDurationOrBuilder()
       The offset between the "first" and "second" event. It can be negative.
       
      .google.protobuf.Duration offset_duration = 5;
      Specified by:
      getOffsetDurationOrBuilder in interface ShipmentModel.PrecedenceRuleOrBuilder