Class CustomerGroupBuilder

java.lang.Object
com.commercetools.api.models.customer_group.CustomerGroupBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<CustomerGroup>

public class CustomerGroupBuilder extends Object implements io.vrap.rmf.base.client.Builder<CustomerGroup>
CustomerGroupBuilder
Example to create an instance using the builder pattern

     CustomerGroup customerGroup = CustomerGroup.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .name("{name}")
             .build()
 
  • Constructor Details

    • CustomerGroupBuilder

      public CustomerGroupBuilder()
  • Method Details

    • id

      public CustomerGroupBuilder id(String id)

      Unique identifier of the CustomerGroup.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public CustomerGroupBuilder version(Long version)

      Current version of the CustomerGroup.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public CustomerGroupBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the CustomerGroup was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public CustomerGroupBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the CustomerGroup was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      Present on resources updated after 1 February 2019 except for events not tracked.

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

      public CustomerGroupBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      Present on resources updated after 1 February 2019 except for events not tracked.

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

      public CustomerGroupBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      Present on resources updated after 1 February 2019 except for events not tracked.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      Present on resources created after 1 February 2019 except for events not tracked.

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

      public CustomerGroupBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      Present on resources created after 1 February 2019 except for events not tracked.

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

      public CustomerGroupBuilder createdBy(@Nullable CreatedBy createdBy)

      Present on resources created after 1 February 2019 except for events not tracked.

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

      User-defined unique identifier for the CustomerGroup.

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

      public CustomerGroupBuilder name(String name)

      Unique name of the CustomerGroup.

      Parameters:
      name - 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

      Custom Fields for the CustomerGroup.

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

      public String getId()

      Unique identifier of the CustomerGroup.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the CustomerGroup.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the CustomerGroup was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the CustomerGroup was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      Present on resources updated after 1 February 2019 except for events not tracked.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      createdBy
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the CustomerGroup.

      Returns:
      key
    • getName

      public String getName()

      Unique name of the CustomerGroup.

      Returns:
      name
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields for the CustomerGroup.

      Returns:
      custom
    • build

      public CustomerGroup build()
      builds CustomerGroup with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<CustomerGroup>
      Returns:
      CustomerGroup
    • buildUnchecked

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

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

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