Class ReplicaCartDraftBuilder

java.lang.Object
com.commercetools.api.models.cart.ReplicaCartDraftBuilder
All Implemented Interfaces:
Builder<ReplicaCartDraft>

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

     ReplicaCartDraft replicaCartDraft = ReplicaCartDraft.builder()
             .reference(referenceBuilder -> referenceBuilder)
             .build()
 
  • Constructor Details

    • ReplicaCartDraftBuilder

      public ReplicaCartDraftBuilder()
  • Method Details

    • reference

      public ReplicaCartDraftBuilder reference(Reference reference)

      A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

      Parameters:
      reference - value to be set
      Returns:
      Builder
    • reference

      public ReplicaCartDraftBuilder reference(Function<ReferenceBuilder,Builder<? extends Reference>> builder)

      A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

      Parameters:
      builder - function to build the reference value
      Returns:
      Builder
    • key

      User-defined unique identifier for the Cart.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • getReference

      public Reference getReference()

      A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

      Returns:
      reference
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the Cart.

      Returns:
      key
    • build

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

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

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

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