Class TrackingDataBuilder

java.lang.Object
com.commercetools.history.models.common.TrackingDataBuilder
All Implemented Interfaces:
Builder<TrackingData>

public class TrackingDataBuilder extends Object implements Builder<TrackingData>
TrackingDataBuilder
Example to create an instance using the builder pattern

     TrackingData trackingData = TrackingData.builder()
             .trackingId("{trackingId}")
             .carrier("{carrier}")
             .provider("{provider}")
             .providerTransaction("{providerTransaction}")
             .isReturn(true)
             .build()
 
  • Constructor Details

    • TrackingDataBuilder

      public TrackingDataBuilder()
  • Method Details

    • trackingId

      public TrackingDataBuilder trackingId(String trackingId)

      The ID to track one parcel.

      Parameters:
      trackingId - value to be set
      Returns:
      Builder
    • carrier

      public TrackingDataBuilder carrier(String carrier)

      The carrier that delivers the parcel.

      Parameters:
      carrier - value to be set
      Returns:
      Builder
    • provider

      public TrackingDataBuilder provider(String provider)
      set the value to the provider
      Parameters:
      provider - value to be set
      Returns:
      Builder
    • providerTransaction

      public TrackingDataBuilder providerTransaction(String providerTransaction)
      set the value to the providerTransaction
      Parameters:
      providerTransaction - value to be set
      Returns:
      Builder
    • isReturn

      public TrackingDataBuilder isReturn(Boolean isReturn)

      Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

      Parameters:
      isReturn - value to be set
      Returns:
      Builder
    • getTrackingId

      public String getTrackingId()

      The ID to track one parcel.

      Returns:
      trackingId
    • getCarrier

      public String getCarrier()

      The carrier that delivers the parcel.

      Returns:
      carrier
    • getProvider

      public String getProvider()
      value of provider}
      Returns:
      provider
    • getProviderTransaction

      public String getProviderTransaction()
      value of providerTransaction}
      Returns:
      providerTransaction
    • getIsReturn

      public Boolean getIsReturn()

      Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

      Returns:
      isReturn
    • build

      public TrackingData build()
      builds TrackingData with checking for non-null required values
      Specified by:
      build in interface Builder<TrackingData>
      Returns:
      TrackingData
    • buildUnchecked

      public TrackingData buildUnchecked()
      builds TrackingData without checking for non-null required values
      Returns:
      TrackingData
    • of

      public static TrackingDataBuilder of()
      factory method for an instance of TrackingDataBuilder
      Returns:
      builder
    • of

      public static TrackingDataBuilder of(TrackingData template)
      create builder for TrackingData instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder