public final class CategoryAssetUpdateActionUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <D> java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> |
buildActions(D newResource,
io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAsset,
CategorySyncOptions syncOptions)
Compares all the fields of an
Asset and an AssetDraft and returns a list of
UpdateAction <Category > as a result. |
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> |
buildChangeAssetNameUpdateAction(io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAsset)
Compares the
LocalizedString names of an Asset and an AssetDraft and
returns an UpdateAction <Category > as a result in an Optional . |
static <D> java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> |
buildCustomUpdateActions(D newCategory,
io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAsset,
CategorySyncOptions syncOptions)
Compares the custom fields and custom types of an
Asset and an AssetDraft and
returns a list of UpdateAction <Category > as a result. |
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> |
buildSetAssetDescriptionUpdateAction(io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAsset)
Compares the
LocalizedString descriptions of an Asset and an AssetDraft
and returns an UpdateAction <Category > as a result in an Optional . |
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> |
buildSetAssetSourcesUpdateAction(io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAsset)
Compares the sources of an
Asset and an AssetDraft and returns an UpdateAction <Category > as a result in an Optional . |
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> |
buildSetAssetTagsUpdateAction(io.sphere.sdk.models.Asset oldAsset,
io.sphere.sdk.models.AssetDraft newAsset)
Compares the tags of an
Asset and an AssetDraft and returns an UpdateAction <Category > as a result in an Optional . |
@Nonnull public static <D> java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> buildActions(@Nonnull D newResource, @Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAsset, @Nonnull CategorySyncOptions syncOptions)
Asset
and an AssetDraft
and returns a list of
UpdateAction
<Category
> as a result. If both the Asset
and the
AssetDraft
have identical fields, then no update action is needed and hence an empty
List
is returned.D
- Type of the mainresource draftnewResource
- new mainresource draft, which contains the asset to update.oldAsset
- the asset which should be updated.newAsset
- the asset draft where we get the new fields.syncOptions
- responsible for supplying the sync options to the sync utility method. It is
used for triggering the error callback within the utility, in case of errors.@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> buildChangeAssetNameUpdateAction(@Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAsset)
LocalizedString
names of an Asset
and an AssetDraft
and
returns an UpdateAction
<Category
> as a result in an Optional
. If
both the Asset
and the AssetDraft
have the same name, then no update action is
needed and hence an empty Optional
is returned.oldAsset
- the asset which should be updated.newAsset
- the asset draft where we get the new name.@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> buildSetAssetDescriptionUpdateAction(@Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAsset)
LocalizedString
descriptions of an Asset
and an AssetDraft
and returns an UpdateAction
<Category
> as a result in an Optional
.
If both the Asset
and the AssetDraft
have the same description, then no update
action is needed and hence an empty Optional
is returned.oldAsset
- the asset which should be updated.newAsset
- the asset draft where we get the new description.@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> buildSetAssetTagsUpdateAction(@Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAsset)
Asset
and an AssetDraft
and returns an UpdateAction
<Category
> as a result in an Optional
. If both the Asset
and the AssetDraft
have the same tags, then no update action is needed and hence
an empty Optional
is returned.oldAsset
- the asset which should be updated.newAsset
- the asset draft where we get the new tags.@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> buildSetAssetSourcesUpdateAction(@Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAsset)
Asset
and an AssetDraft
and returns an UpdateAction
<Category
> as a result in an Optional
. If both the Asset
and the AssetDraft
have the same sources, then no update action is needed and
hence an empty Optional
is returned.oldAsset
- the asset which should be updated.newAsset
- the asset draft where we get the new sources.@Nonnull public static <D> java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.categories.Category>> buildCustomUpdateActions(@Nonnull D newCategory, @Nonnull io.sphere.sdk.models.Asset oldAsset, @Nonnull io.sphere.sdk.models.AssetDraft newAsset, @Nonnull CategorySyncOptions syncOptions)
Asset
and an AssetDraft
and
returns a list of UpdateAction
<Category
> as a result. If both the Asset
and the AssetDraft
have identical custom fields and types, then no update action
is needed and hence an empty List
is returned.D
- Type of the mainresource draftnewCategory
- category in a source project, which contains the updated asset.oldAsset
- the asset which should be updated.newAsset
- the asset draft where we get the new custom fields and types.syncOptions
- responsible for supplying the sync options to the sync utility method. It is
used for triggering the error callback within the utility, in case of errors.