Class CustomerGroupDraftBuilder

java.lang.Object
com.commercetools.api.models.customer_group.CustomerGroupDraftBuilder
All Implemented Interfaces:
Builder<CustomerGroupDraft>

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

     CustomerGroupDraft customerGroupDraft = CustomerGroupDraft.builder()
             .groupName("{groupName}")
             .build()
 
  • Constructor Details

    • CustomerGroupDraftBuilder

      public CustomerGroupDraftBuilder()
  • Method Details

    • key

      public CustomerGroupDraftBuilder key(@Nullable String key)

      User-defined unique identifier for the CustomerGroup.

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

      public CustomerGroupDraftBuilder groupName(String groupName)

      Unique value which must be different from any value used for name in CustomerGroup in the Project. If not, a DuplicateField error is returned.

      Parameters:
      groupName - value to be set
      Returns:
      Builder
    • custom

      Custom Fields for the CustomerGroup.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields for the CustomerGroup.

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

      public CustomerGroupDraftBuilder custom(@Nullable CustomFieldsDraft custom)

      Custom Fields for the CustomerGroup.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the CustomerGroup.

      Returns:
      key
    • getGroupName

      public String getGroupName()

      Unique value which must be different from any value used for name in CustomerGroup in the Project. If not, a DuplicateField error is returned.

      Returns:
      groupName
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the CustomerGroup.

      Returns:
      custom
    • build

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

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

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

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