Class TrackingDataBuilder

java.lang.Object
com.commercetools.api.models.order.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()
             .build()
 
  • Constructor Details

    • TrackingDataBuilder

      public TrackingDataBuilder()
  • Method Details

    • trackingId

      public TrackingDataBuilder trackingId(@Nullable String trackingId)

      Identifier to track the Parcel.

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

      public TrackingDataBuilder carrier(@Nullable String carrier)

      Name of the carrier that delivers the Parcel.

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

      public TrackingDataBuilder provider(@Nullable String provider)

      Name of the provider that serves as facade to several carriers.

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

      public TrackingDataBuilder providerTransaction(@Nullable String providerTransaction)

      Transaction identifier with the provider.

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

      public TrackingDataBuilder isReturn(@Nullable Boolean isReturn)
      • If true, the Parcel is being returned.
      • If false, the Parcel is being delivered to the customer.
      Parameters:
      isReturn - value to be set
      Returns:
      Builder
    • getTrackingId

      @Nullable public String getTrackingId()

      Identifier to track the Parcel.

      Returns:
      trackingId
    • getCarrier

      @Nullable public String getCarrier()

      Name of the carrier that delivers the Parcel.

      Returns:
      carrier
    • getProvider

      @Nullable public String getProvider()

      Name of the provider that serves as facade to several carriers.

      Returns:
      provider
    • getProviderTransaction

      @Nullable public String getProviderTransaction()

      Transaction identifier with the provider.

      Returns:
      providerTransaction
    • getIsReturn

      @Nullable public Boolean getIsReturn()
      • If true, the Parcel is being returned.
      • If false, the Parcel is being delivered to the customer.
      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