Interface Division

All Superinterfaces:
BaseResource, BusinessUnit, WithKey

public interface Division extends BusinessUnit

Business Unit type to model divisions that are part of the Company or a higher-order Division. Contains specific fields and values that differentiate a Division from the generic BusinessUnit.


Example to create an instance using the builder pattern

     Division division = Division.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)
             .parentUnit(parentUnitBuilder -> parentUnitBuilder)
             .topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getParentUnit

      @NotNull @Valid @NotNull @Valid BusinessUnitKeyReference getParentUnit()

      Parent unit of the Division.

      Specified by:
      getParentUnit in interface BusinessUnit
      Returns:
      parentUnit
    • getStoreMode

      @NotNull @NotNull BusinessUnitStoreMode getStoreMode()

      Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

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

      @NotNull @NotNull BusinessUnitAssociateMode getAssociateMode()

      Determines whether the Division can inherit Associates from a parent.

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

      void setParentUnit(BusinessUnitKeyReference parentUnit)

      Parent unit of the Division.

      Specified by:
      setParentUnit in interface BusinessUnit
      Parameters:
      parentUnit - value to be set
    • setStoreMode

      void setStoreMode(BusinessUnitStoreMode storeMode)

      Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

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

      void setAssociateMode(BusinessUnitAssociateMode associateMode)

      Determines whether the Division can inherit Associates from a parent.

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

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

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

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

      static DivisionBuilder builder()
      builder factory method for Division
      Returns:
      builder
    • builder

      static DivisionBuilder builder(Division template)
      create builder for Division instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDivision

      default <T> T withDivision(Function<Division,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<Division> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference