public final class LocalizedEnumValueUpdateActionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> |
buildChangeLabelAction(java.lang.String attributeDefinitionName,
io.sphere.sdk.models.LocalizedEnumValue oldEnumValue,
io.sphere.sdk.models.LocalizedEnumValue newEnumValue)
Compares the
label values of an old LocalizedEnumValue and a new LocalizedEnumValue
and returns an Optional of update action, which would contain the "changeLabel"
UpdateAction. |
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> |
buildLocalizedEnumValuesUpdateActions(java.lang.String attributeDefinitionName,
java.util.List<io.sphere.sdk.models.LocalizedEnumValue> oldEnumValues,
java.util.List<io.sphere.sdk.models.LocalizedEnumValue> newEnumValues)
Compares a list of old
LocalizedEnumValues with a list of new LocalizedEnumValues for a given
attribute definition and builds required update actions (e.g addLocalizedEnumValue, removeLocalizedEnumValue,
changeLocalizedEnumValueOrder) and 1-1 update actions on localized enum values
(e.g. |
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> |
buildLocalizedEnumValueUpdateActions(java.lang.String attributeDefinitionName,
io.sphere.sdk.models.LocalizedEnumValue oldEnumValue,
io.sphere.sdk.models.LocalizedEnumValue newEnumValue)
Compares all the fields of an old
LocalizedEnumValue and a new LocalizedEnumValue and returns a
list of UpdateAction<ProductType> as a result. |
@Nonnull
public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> buildLocalizedEnumValuesUpdateActions(@Nonnull
java.lang.String attributeDefinitionName,
@Nonnull
java.util.List<io.sphere.sdk.models.LocalizedEnumValue> oldEnumValues,
@Nullable
java.util.List<io.sphere.sdk.models.LocalizedEnumValue> newEnumValues)
LocalizedEnumValues with a list of new LocalizedEnumValues for a given
attribute definition and builds required update actions (e.g addLocalizedEnumValue, removeLocalizedEnumValue,
changeLocalizedEnumValueOrder) and 1-1 update actions on localized enum values
(e.g. changeLocalizedEnumValueLabel) for the required resource. If both the LocalizedEnumValue's are
identical, then no update action is needed and hence an empty List is returned.
If the list of new LocalizedEnumValues is null, then remove actions are built for
every existing localized enum value in the oldEnumValues list.
attributeDefinitionName - the attribute name whose localized enum values are going to be synced.oldEnumValues - the old list of localized enum values.newEnumValues - the new list of localized enum values.DuplicateKeyException - in case there are localized enum values with duplicate keys.@Nonnull
public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> buildLocalizedEnumValueUpdateActions(@Nonnull
java.lang.String attributeDefinitionName,
@Nonnull
io.sphere.sdk.models.LocalizedEnumValue oldEnumValue,
@Nonnull
io.sphere.sdk.models.LocalizedEnumValue newEnumValue)
LocalizedEnumValue and a new LocalizedEnumValue and returns a
list of UpdateAction<ProductType> as a result. If both LocalizedEnumValue have
identical fields then no update action is needed and hence an empty List is returned.attributeDefinitionName - the attribute definition name whose localized enum values belong to.oldEnumValue - the localized enum value which should be updated.newEnumValue - the localized enum value where we get the new fields.@Nonnull
public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.producttypes.ProductType>> buildChangeLabelAction(@Nonnull
java.lang.String attributeDefinitionName,
@Nonnull
io.sphere.sdk.models.LocalizedEnumValue oldEnumValue,
@Nonnull
io.sphere.sdk.models.LocalizedEnumValue newEnumValue)
label values of an old LocalizedEnumValue and a new LocalizedEnumValue
and returns an Optional of update action, which would contain the "changeLabel"
UpdateAction. If both, old and new LocalizedEnumValue have the same label values,
then no update action is needed and empty optional will be returned.attributeDefinitionName - the attribute definition name whose localized enum values belong to.oldEnumValue - the old localized enum value.newEnumValue - the new localized enum value which contains the new description.