Interface Company

All Superinterfaces:
BaseResource, BusinessUnit, WithKey

public interface Company extends BusinessUnit

Business Unit type to represent the top level of a business. Contains specific fields and values that differentiate a Company from the generic BusinessUnit.


Example to create an instance using the builder pattern

     Company company = Company.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}")
             .status(BusinessUnitStatus.ACTIVE)
             .storeMode(BusinessUnitStoreMode.EXPLICIT)
             .name("{name}")
             .plusAddresses(addressesBuilder -> addressesBuilder)
             .associateMode(BusinessUnitAssociateMode.EXPLICIT)
             .plusAssociates(associatesBuilder -> associatesBuilder)
             .topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
             .approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
             .build()
 
  • Field Details

  • Method Details

    • getStoreMode

      @NotNull @NotNull BusinessUnitStoreMode getStoreMode()

      The value of this field is always Explicit because a Company cannot have a parent Business Unit that Stores can be inherited from.

      Specified by:
      getStoreMode in interface BusinessUnit
      Returns:
      storeMode
    • getAssociateMode

      @NotNull @NotNull BusinessUnitAssociateMode getAssociateMode()

      The value of this field is always Explicit because a Company cannot have a parent Business Unit that Associates can be inherited from.

      Specified by:
      getAssociateMode in interface BusinessUnit
      Returns:
      associateMode
    • getApprovalRuleMode

      @NotNull @NotNull BusinessUnitApprovalRuleMode getApprovalRuleMode()

      The value of this field is always Explicit because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.

      Specified by:
      getApprovalRuleMode in interface BusinessUnit
      Returns:
      approvalRuleMode
    • setStoreMode

      void setStoreMode(BusinessUnitStoreMode storeMode)

      The value of this field is always Explicit because a Company cannot have a parent Business Unit that Stores can be inherited from.

      Specified by:
      setStoreMode in interface BusinessUnit
      Parameters:
      storeMode - value to be set
    • setAssociateMode

      void setAssociateMode(BusinessUnitAssociateMode associateMode)

      The value of this field is always Explicit because a Company cannot have a parent Business Unit that Associates can be inherited from.

      Specified by:
      setAssociateMode in interface BusinessUnit
      Parameters:
      associateMode - value to be set
    • setApprovalRuleMode

      void setApprovalRuleMode(BusinessUnitApprovalRuleMode approvalRuleMode)

      The value of this field is always Explicit because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.

      Specified by:
      setApprovalRuleMode in interface BusinessUnit
      Parameters:
      approvalRuleMode - value to be set
    • of

      static Company of()
      factory method
      Returns:
      instance of Company
    • of

      static Company of(Company template)
      factory method to create a shallow copy Company
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Company deepCopy(@Nullable Company template)
      factory method to create a deep copy of Company
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static CompanyBuilder builder()
      builder factory method for Company
      Returns:
      builder
    • builder

      static CompanyBuilder builder(Company template)
      create builder for Company instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCompany

      default <T> T withCompany(Function<Company,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Company> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference