T
- the type of the resource the asset update actions are built for.D
- the type of the draft, which contains the changes the asset update actions are built
for.public abstract class AssetActionFactory<T extends io.sphere.sdk.models.Resource,D>
extends java.lang.Object
T
.Modifier and Type | Field and Description |
---|---|
BaseSyncOptions |
syncOptions |
Constructor and Description |
---|
AssetActionFactory() |
Modifier and Type | Method and Description |
---|---|
abstract io.sphere.sdk.commands.UpdateAction<T> |
buildAddAssetAction(io.sphere.sdk.models.AssetDraft newAssetDraft,
java.lang.Integer position)
Takes an asset draft and an asset position to build an AddAsset action of the type T.
|
abstract java.util.List<io.sphere.sdk.commands.UpdateAction<T>> |
buildAssetActions(D newResource,
io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAssetDraft)
Takes a matching old asset and a new asset and computes the update actions needed to sync them.
|
abstract io.sphere.sdk.commands.UpdateAction<T> |
buildChangeAssetOrderAction(java.util.List<java.lang.String> newAssetOrder)
Takes a list of asset ids to build a ChangeAssetOrder action of the type T.
|
abstract io.sphere.sdk.commands.UpdateAction<T> |
buildRemoveAssetAction(java.lang.String assetKey)
Takes an asset key to build a RemoveAsset action of the type T.
|
public BaseSyncOptions syncOptions
public abstract java.util.List<io.sphere.sdk.commands.UpdateAction<T>> buildAssetActions(@Nonnull D newResource, @Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAssetDraft)
newResource
- new mainresource draft, which contains the asset to update.oldAsset
- the old asset to compare.newAssetDraft
- the matching new asset draft.public abstract io.sphere.sdk.commands.UpdateAction<T> buildRemoveAssetAction(@Nonnull java.lang.String assetKey)
assetKey
- the key of the asset used un building the update action.public abstract io.sphere.sdk.commands.UpdateAction<T> buildChangeAssetOrderAction(@Nonnull java.util.List<java.lang.String> newAssetOrder)
newAssetOrder
- the new asset order needed to build the action.public abstract io.sphere.sdk.commands.UpdateAction<T> buildAddAssetAction(@Nonnull io.sphere.sdk.models.AssetDraft newAssetDraft, @Nonnull java.lang.Integer position)
newAssetDraft
- the new asset draft to create an Add asset action for.position
- the position to add the new asset to.