Class TaxCategoryUpdateActionUtils
- java.lang.Object
-
- com.commercetools.sync.taxcategories.utils.TaxCategoryUpdateActionUtils
-
public final class TaxCategoryUpdateActionUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.taxcategories.TaxCategory>>buildChangeNameAction(io.sphere.sdk.taxcategories.TaxCategory oldTaxCategory, io.sphere.sdk.taxcategories.TaxCategoryDraft newTaxCategory)Compares thenamevalues of aTaxCategoryand aTaxCategoryDraftand returns anOptionalof update action, which would contain the"changeName"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.taxcategories.TaxCategory>>buildSetDescriptionAction(io.sphere.sdk.taxcategories.TaxCategory oldTaxCategory, io.sphere.sdk.taxcategories.TaxCategoryDraft newTaxCategory)Compares thedescriptionvalues of aTaxCategoryand aTaxCategoryDraftand returns anOptionalof update action, which would contain the"setDescription"UpdateAction.static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.taxcategories.TaxCategory>>buildTaxRateUpdateActions(io.sphere.sdk.taxcategories.TaxCategory oldTaxCategory, io.sphere.sdk.taxcategories.TaxCategoryDraft newTaxCategory)Compares the tax rates of aTaxCategoryand aTaxCategoryDraftand returns a list ofUpdateAction<TaxCategory> as a result.
-
-
-
Method Detail
-
buildChangeNameAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.taxcategories.TaxCategory>> buildChangeNameAction(@Nonnull io.sphere.sdk.taxcategories.TaxCategory oldTaxCategory, @Nonnull io.sphere.sdk.taxcategories.TaxCategoryDraft newTaxCategory)Compares thenamevalues of aTaxCategoryand aTaxCategoryDraftand returns anOptionalof update action, which would contain the"changeName"UpdateAction. If bothTaxCategoryandTaxCategoryDrafthave the samenamevalues, then no update action is needed and empty optional will be returned.- Parameters:
oldTaxCategory- the tax category that should be updated.newTaxCategory- the tax category draft which contains the new name.- Returns:
- optional containing update action or empty optional if names are identical.
-
buildSetDescriptionAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.taxcategories.TaxCategory>> buildSetDescriptionAction(@Nonnull io.sphere.sdk.taxcategories.TaxCategory oldTaxCategory, @Nonnull io.sphere.sdk.taxcategories.TaxCategoryDraft newTaxCategory)Compares thedescriptionvalues of aTaxCategoryand aTaxCategoryDraftand returns anOptionalof update action, which would contain the"setDescription"UpdateAction. If bothTaxCategoryandTaxCategoryDrafthave the samedescriptionvalues, then no update action is needed and empty optional will be returned.- Parameters:
oldTaxCategory- the tax category that should be updated.newTaxCategory- the tax category draft which contains the new description.- Returns:
- optional containing update action or empty optional if descriptions are identical.
-
buildTaxRateUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.taxcategories.TaxCategory>> buildTaxRateUpdateActions(@Nonnull io.sphere.sdk.taxcategories.TaxCategory oldTaxCategory, @Nonnull io.sphere.sdk.taxcategories.TaxCategoryDraft newTaxCategory)Compares the tax rates of aTaxCategoryand aTaxCategoryDraftand returns a list ofUpdateAction<TaxCategory> as a result. If both theTaxCategoryand theTaxCategoryDrafthave identical tax rates, then no update action is needed and hence an emptyListis returned.- Parameters:
oldTaxCategory- the tax category which should be updated.newTaxCategory- the tax category draft where we get the key.- Returns:
- A list with the update actions or an empty list if the tax rates are identical.
-
-