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)
             .plusStores(storesBuilder -> storesBuilder)
             .storeMode(BusinessUnitStoreMode.EXPLICIT)
             .name("{name}")
             .plusAddresses(addressesBuilder -> addressesBuilder)
             .associateMode(BusinessUnitAssociateMode.EXPLICIT)
             .plusAssociates(associatesBuilder -> associatesBuilder)
             .topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getStoreMode

      @NotNull @NotNull BusinessUnitStoreMode getStoreMode()

      Is always Explicit since 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()

      Is always Explicit since a Company cannot have a parent Business Unit that Associates can be inherited from.

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

      void setStoreMode(BusinessUnitStoreMode storeMode)

      Is always Explicit since 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)

      Is always Explicit since 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
    • 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