Class CategoryAssetActionFactory


  • public final class CategoryAssetActionFactory
    extends AssetActionFactory<com.commercetools.api.models.category.CategoryUpdateAction,​com.commercetools.api.models.category.CategoryDraft>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.commercetools.api.models.category.CategoryUpdateAction buildAddAssetAction​(com.commercetools.api.models.common.AssetDraft assetDraft, java.lang.Integer position)
      Takes an asset draft and an asset position to build an AddAsset action of the type T.
      java.util.List<com.commercetools.api.models.category.CategoryUpdateAction> buildAssetActions​(com.commercetools.api.models.category.CategoryDraft newResource, com.commercetools.api.models.common.Asset oldAsset, com.commercetools.api.models.common.AssetDraft newAssetDraft)
      Takes a matching old asset and a new asset and computes the update actions needed to sync them.
      com.commercetools.api.models.category.CategoryUpdateAction buildChangeAssetOrderAction​(java.util.List<java.lang.String> newAssetOrder)
      Takes a list of asset ids to build a ChangeAssetOrder action of the type T.
      com.commercetools.api.models.category.CategoryUpdateAction buildRemoveAssetAction​(java.lang.String assetKey)
      Takes an asset key to build a RemoveAsset action of the type T.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CategoryAssetActionFactory

        public CategoryAssetActionFactory​(@Nonnull
                                          CategorySyncOptions syncOptions)
    • Method Detail

      • buildAssetActions

        public java.util.List<com.commercetools.api.models.category.CategoryUpdateAction> buildAssetActions​(@Nonnull
                                                                                                            com.commercetools.api.models.category.CategoryDraft newResource,
                                                                                                            @Nonnull
                                                                                                            com.commercetools.api.models.common.Asset oldAsset,
                                                                                                            @Nonnull
                                                                                                            com.commercetools.api.models.common.AssetDraft newAssetDraft)
        Description copied from class: AssetActionFactory
        Takes a matching old asset and a new asset and computes the update actions needed to sync them.
        Specified by:
        buildAssetActions in class AssetActionFactory<com.commercetools.api.models.category.CategoryUpdateAction,​com.commercetools.api.models.category.CategoryDraft>
        Parameters:
        newResource - new mainresource draft, which contains the asset to update.
        oldAsset - the old asset to compare.
        newAssetDraft - the matching new asset draft.
        Returns:
        update actions needed to sync the two assets.
      • buildRemoveAssetAction

        public com.commercetools.api.models.category.CategoryUpdateAction buildRemoveAssetAction​(@Nonnull
                                                                                                 java.lang.String assetKey)
        Description copied from class: AssetActionFactory
        Takes an asset key to build a RemoveAsset action of the type T.
        Specified by:
        buildRemoveAssetAction in class AssetActionFactory<com.commercetools.api.models.category.CategoryUpdateAction,​com.commercetools.api.models.category.CategoryDraft>
        Parameters:
        assetKey - the key of the asset used un building the update action.
        Returns:
        the built remove asset update action.
      • buildChangeAssetOrderAction

        public com.commercetools.api.models.category.CategoryUpdateAction buildChangeAssetOrderAction​(@Nonnull
                                                                                                      java.util.List<java.lang.String> newAssetOrder)
        Description copied from class: AssetActionFactory
        Takes a list of asset ids to build a ChangeAssetOrder action of the type T.
        Specified by:
        buildChangeAssetOrderAction in class AssetActionFactory<com.commercetools.api.models.category.CategoryUpdateAction,​com.commercetools.api.models.category.CategoryDraft>
        Parameters:
        newAssetOrder - the new asset order needed to build the action.
        Returns:
        the built update action.
      • buildAddAssetAction

        public com.commercetools.api.models.category.CategoryUpdateAction buildAddAssetAction​(@Nonnull
                                                                                              com.commercetools.api.models.common.AssetDraft assetDraft,
                                                                                              @Nonnull
                                                                                              java.lang.Integer position)
        Description copied from class: AssetActionFactory
        Takes an asset draft and an asset position to build an AddAsset action of the type T. buildRemoveAssetAction
        Specified by:
        buildAddAssetAction in class AssetActionFactory<com.commercetools.api.models.category.CategoryUpdateAction,​com.commercetools.api.models.category.CategoryDraft>
        Parameters:
        assetDraft - the new asset draft to create an Add asset action for.
        position - the position to add the new asset to.
        Returns:
        the built update action.