public final class ProductTypeUpdateActionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> |
buildAttributesUpdateActions(io.sphere.sdk.producttypes.ProductType oldProductType,
io.sphere.sdk.producttypes.ProductTypeDraft newProductType,
ProductTypeSyncOptions syncOptions)
Compares the attributes of a
ProductType and a ProductTypeDraft and returns a list of
UpdateAction<ProductType> as a result. |
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> |
buildChangeDescriptionAction(io.sphere.sdk.producttypes.ProductType oldProductType,
io.sphere.sdk.producttypes.ProductTypeDraft newProductType)
Compares the
description values of a ProductType and a ProductTypeDraft
and returns an Optional of update action, which would contain the "changeDescription"
UpdateAction. |
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> |
buildChangeNameAction(io.sphere.sdk.producttypes.ProductType oldProductType,
io.sphere.sdk.producttypes.ProductTypeDraft newProductType)
Compares the
name values of a ProductType and a ProductTypeDraft
and returns an Optional of update action, which would contain the "changeName"
UpdateAction. |
@Nonnull
public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> buildChangeNameAction(@Nonnull
io.sphere.sdk.producttypes.ProductType oldProductType,
@Nonnull
io.sphere.sdk.producttypes.ProductTypeDraft newProductType)
name values of a ProductType and a ProductTypeDraft
and returns an Optional of update action, which would contain the "changeName"
UpdateAction. If both ProductType and ProductTypeDraft have the same
name values, then no update action is needed and empty optional will be returned.oldProductType - the product type that should be updated.newProductType - the product type draft which contains the new name.@Nonnull
public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> buildChangeDescriptionAction(@Nonnull
io.sphere.sdk.producttypes.ProductType oldProductType,
@Nonnull
io.sphere.sdk.producttypes.ProductTypeDraft newProductType)
description values of a ProductType and a ProductTypeDraft
and returns an Optional of update action, which would contain the "changeDescription"
UpdateAction. If both ProductType and ProductTypeDraft have the same
description values, then no update action is needed and empty optional will be returned.oldProductType - the product type that should be updated.newProductType - the product type draft which contains the new description.@Nonnull
public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> buildAttributesUpdateActions(@Nonnull
io.sphere.sdk.producttypes.ProductType oldProductType,
@Nonnull
io.sphere.sdk.producttypes.ProductTypeDraft newProductType,
@Nonnull
ProductTypeSyncOptions syncOptions)
ProductType and a ProductTypeDraft and returns a list of
UpdateAction<ProductType> as a result. If both the ProductType and
the ProductTypeDraft have identical attributes, then no update action is needed and hence an empty
List is returned. In case, the new product type draft has a list of attributes in which a duplicate name
exists, the error callback is triggered and an empty list is returned.oldProductType - the product type which should be updated.newProductType - the product type draft where we get the key.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.