Class CloneProductVariantsService<P extends Product,R extends CloneProductRequest>

java.lang.Object
com.broadleafcommerce.catalog.clone.product.service.CloneProductVariantsService<P,R>
All Implemented Interfaces:
CloneProductRelationshipsService<P,R>, org.springframework.core.Ordered

public class CloneProductVariantsService<P extends Product,R extends CloneProductRequest> extends Object implements CloneProductRelationshipsService<P,R>
Clone the Variant.
Author:
Dima Myroniuk (dmyroniuk)
  • Constructor Details

    • CloneProductVariantsService

      public CloneProductVariantsService(VariantService<Variant> variantService)
  • Method Details

    • canHandle

      public boolean canHandle(String relationshipType)
      Description copied from interface: CloneProductRelationshipsService
      Check if this service can clone specific relationship type.
      Specified by:
      canHandle in interface CloneProductRelationshipsService<P extends Product,R extends CloneProductRequest>
      Parameters:
      relationshipType - the relationship type to clone
      Returns:
      true if this service can clone specific relationship type, false otherwise
    • executeCloneRelationship

      public void executeCloneRelationship(R request, P original, P cloned, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: CloneProductRelationshipsService
      Clone the Product relationships.
      Specified by:
      executeCloneRelationship in interface CloneProductRelationshipsService<P extends Product,R extends CloneProductRequest>
      Parameters:
      request - the request to perform the clone operation
      original - the original product that this is being cloned from
      cloned - the Product for which to clone relationships. The cloned relationships will be assigned to this Product
      context - context information surrounding sandboxing and multitenant state
    • getSubContainerName

      public String getSubContainerName()
      Description copied from interface: CloneProductRelationshipsService
      The name of the sub-container (second-level entity), which is typically snake-cased and capitalized i.e., "PRICE_DATA".
      Specified by:
      getSubContainerName in interface CloneProductRelationshipsService<P extends Product,R extends CloneProductRequest>
      Returns:
      The name of the sub-container (second-level entity), which is typically snake-cased and capitalized, i.e., "PRICE_DATA"
      See Also:
      • ChangeContainer.getSubContainerName()
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • getVariantService

      protected VariantService<Variant> getVariantService()