Class ShoppingListUpdateActionUtils
- java.lang.Object
-
- com.commercetools.sync.shoppinglists.utils.ShoppingListUpdateActionUtils
-
public final class ShoppingListUpdateActionUtils 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.shoppinglists.ShoppingList>>
buildChangeNameUpdateAction(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares theLocalizedString
names of aShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>>
buildSetAnonymousIdUpdateAction(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares the anonymousIds ofShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>>
buildSetCustomerUpdateAction(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares the customer references of aShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>>
buildSetDeleteDaysAfterLastModificationUpdateAction(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares the deleteDaysAfterLastModification ofShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>>
buildSetDescriptionUpdateAction(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares theLocalizedString
descriptions ofShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>>
buildSetSlugUpdateAction(io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares theLocalizedString
slugs of aShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
.
-
-
-
Method Detail
-
buildSetSlugUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildSetSlugUpdateAction(@Nonnull io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, @Nonnull io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares theLocalizedString
slugs of aShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
. If both theShoppingList
and theShoppingListDraft
have the same slug, then no update action is needed and hence an emptyOptional
is returned.- Parameters:
oldShoppingList
- the shopping list which should be updated.newShoppingList
- the shopping list draft where we get the new slug.- Returns:
- A filled optional with the update action or an empty optional if the slugs are identical.
-
buildChangeNameUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildChangeNameUpdateAction(@Nonnull io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, @Nonnull io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares theLocalizedString
names of aShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
. If both theShoppingList
and theShoppingListDraft
have the same name, then no update action is needed and hence an emptyOptional
is returned.- Parameters:
oldShoppingList
- the shopping list which should be updated.newShoppingList
- the shopping list draft where we get the new name.- Returns:
- A filled optional with the update action or an empty optional if the names are identical.
-
buildSetDescriptionUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildSetDescriptionUpdateAction(@Nonnull io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, @Nonnull io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares theLocalizedString
descriptions ofShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
. If both theShoppingList
and theShoppingListDraft
have the same description, then no update action is needed and hence an emptyOptional
is returned.- Parameters:
oldShoppingList
- the shopping list which should be updated.newShoppingList
- the shopping list draft where we get the new description.- Returns:
- A filled optional with the update action or an empty optional if the descriptions are identical.
-
buildSetCustomerUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildSetCustomerUpdateAction(@Nonnull io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, @Nonnull io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares the customer references of aShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
. If both theShoppingList
and theShoppingListDraft
have the same customer, then no update action is needed and hence an emptyOptional
is returned.- Parameters:
oldShoppingList
- the shopping list which should be updated.newShoppingList
- the shopping list draft which holds the new customer.- Returns:
- A filled optional with the update action or an empty optional if the customers are identical.
-
buildSetAnonymousIdUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildSetAnonymousIdUpdateAction(@Nonnull io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, @Nonnull io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares the anonymousIds ofShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
. If both theShoppingList
and theShoppingListDraft
have the same anonymousId, then no update action is needed and hence an emptyOptional
is returned.- Parameters:
oldShoppingList
- the shopping list which should be updated.newShoppingList
- the shopping list draft which holds the new anonymousId.- Returns:
- A filled optional with the update action or an empty optional if the anonymousIds are identical.
-
buildSetDeleteDaysAfterLastModificationUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.shoppinglists.ShoppingList>> buildSetDeleteDaysAfterLastModificationUpdateAction(@Nonnull io.sphere.sdk.shoppinglists.ShoppingList oldShoppingList, @Nonnull io.sphere.sdk.shoppinglists.ShoppingListDraft newShoppingList)
Compares the deleteDaysAfterLastModification ofShoppingList
and aShoppingListDraft
and returns anUpdateAction
<ShoppingList
> as a result in anOptional
. If both theShoppingList
and theShoppingListDraft
have the same deleteDaysAfterLastModification, then no update action is needed and hence an emptyOptional
is returned.- Parameters:
oldShoppingList
- the shopping list which should be updated.newShoppingList
- the shopping list draft which holds the new deleteDaysAfterLastModification.- Returns:
- A filled optional with the update action or an empty optional if the deleteDaysAfterLastModifications are identical.
-
-