Class AssociateRoleBuilder

java.lang.Object
com.commercetools.api.models.associate_role.AssociateRoleBuilder
All Implemented Interfaces:
Builder<AssociateRole>

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

     AssociateRole associateRole = AssociateRole.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .key("{key}")
             .buyerAssignable(true)
             .plusPermissions(permissionsBuilder -> permissionsBuilder)
             .build()
 
  • Constructor Details

    • AssociateRoleBuilder

      public AssociateRoleBuilder()
  • Method Details

    • id

      public AssociateRoleBuilder id(String id)

      Unique identifier of the AssociateRole.

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

      public AssociateRoleBuilder version(Long version)

      Current version of the AssociateRole.

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

      public AssociateRoleBuilder createdAt(ZonedDateTime createdAt)

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

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

      public AssociateRoleBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

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

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

      IDs and references that last modified the AssociateRole.

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

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

      IDs and references that last modified the AssociateRole.

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

      public AssociateRoleBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the AssociateRole.

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

      IDs and references that created the AssociateRole.

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

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

      IDs and references that created the AssociateRole.

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

      public AssociateRoleBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the AssociateRole.

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

      public AssociateRoleBuilder key(String key)

      User-defined unique and immutable identifier of the AssociateRole.

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

      public AssociateRoleBuilder buyerAssignable(Boolean buyerAssignable)

      Whether the AssociateRole can be assigned to an Associate by a buyer. If false, the AssociateRole can only be assigned using the general endpoint.

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

      Name of the AssociateRole.

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

      public AssociateRoleBuilder permissions(Permission... permissions)

      List of Permissions for the AssociateRole.

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

      public AssociateRoleBuilder permissions(List<Permission> permissions)

      List of Permissions for the AssociateRole.

      Parameters:
      permissions - value to be set
      Returns:
      Builder
    • plusPermissions

      public AssociateRoleBuilder plusPermissions(Permission... permissions)

      List of Permissions for the AssociateRole.

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

      Custom Fields for the AssociateRole.

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

      Custom Fields for the AssociateRole.

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

      Custom Fields for the AssociateRole.

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

      public String getId()

      Unique identifier of the AssociateRole.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the AssociateRole.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

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

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

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

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the AssociateRole.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the AssociateRole.

      Returns:
      createdBy
    • getKey

      public String getKey()

      User-defined unique and immutable identifier of the AssociateRole.

      Returns:
      key
    • getBuyerAssignable

      public Boolean getBuyerAssignable()

      Whether the AssociateRole can be assigned to an Associate by a buyer. If false, the AssociateRole can only be assigned using the general endpoint.

      Returns:
      buyerAssignable
    • getName

      @Nullable public String getName()

      Name of the AssociateRole.

      Returns:
      name
    • getPermissions

      public List<Permission> getPermissions()

      List of Permissions for the AssociateRole.

      Returns:
      permissions
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields for the AssociateRole.

      Returns:
      custom
    • build

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

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

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

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