Class InventoryUpdateActionUtils
- java.lang.Object
 - 
- com.commercetools.sync.inventories.utils.InventoryUpdateActionUtils
 
 
- 
public final class InventoryUpdateActionUtils extends java.lang.ObjectThis class provides static utility methods for building update actions related to inventories. 
- 
- 
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.inventory.InventoryEntry>>buildChangeQuantityAction(io.sphere.sdk.inventory.InventoryEntry oldEntry, io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares thequantityOnStockvalues of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"changeQuantity"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>>buildSetExpectedDeliveryAction(io.sphere.sdk.inventory.InventoryEntry oldEntry, io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares theexpectedDeliveryvalues of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"setExpectedDelivery"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>>buildSetRestockableInDaysAction(io.sphere.sdk.inventory.InventoryEntry oldEntry, io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares therestockableInDaysvalues of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"setRestockableInDays"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>>buildSetSupplyChannelAction(io.sphere.sdk.inventory.InventoryEntry oldEntry, io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares thesupplyChannels of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"setSupplyChannel"UpdateAction. 
 - 
 
- 
- 
Method Detail
- 
buildChangeQuantityAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>> buildChangeQuantityAction(@Nonnull io.sphere.sdk.inventory.InventoryEntry oldEntry, @Nonnull io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares thequantityOnStockvalues of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"changeQuantity"UpdateAction. If bothInventoryEntryandInventoryEntryDrafthave the samequantityOnStockvalues, then no update action is needed and empty optional will be returned. If thequantityOnStockfrom thenewEntryisnull, the newquantityOnStockwill have a value of 0L.- Parameters:
 oldEntry- the inventory entry that should be updatednewEntry- the inventory entry draft which contains new quantity on stock- Returns:
 - optional containing update action or empty optional if quantities on stock are identical
 
 
- 
buildSetRestockableInDaysAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>> buildSetRestockableInDaysAction(@Nonnull io.sphere.sdk.inventory.InventoryEntry oldEntry, @Nonnull io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares therestockableInDaysvalues of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"setRestockableInDays"UpdateAction. If bothInventoryEntryand theInventoryEntryDrafthave the samerestockableInDaysvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldEntry- the inventory entry that should be updatednewEntry- the inventory entry draft which contains a newrestockableInDaysvalue- Returns:
 - optional containing update action or empty optional if restockable in days are identical
 
 
- 
buildSetExpectedDeliveryAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>> buildSetExpectedDeliveryAction(@Nonnull io.sphere.sdk.inventory.InventoryEntry oldEntry, @Nonnull io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares theexpectedDeliveryvalues of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"setExpectedDelivery"UpdateAction. If bothInventoryEntryandInventoryEntryDrafthave the sameexpectedDeliveryvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldEntry- the inventory entry that should be updatednewEntry- the inventory entry draft which contains new expected delivery- Returns:
 - optional containing update action or empty optional if expected deliveries are identical
 
 
- 
buildSetSupplyChannelAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>> buildSetSupplyChannelAction(@Nonnull io.sphere.sdk.inventory.InventoryEntry oldEntry, @Nonnull io.sphere.sdk.inventory.InventoryEntryDraft newEntry)Compares thesupplyChannels of anInventoryEntryand anInventoryEntryDraftand returns anOptionalof update action, which would contain the"setSupplyChannel"UpdateAction. If bothInventoryEntryandInventoryEntryDrafthave the same supply channel, then no update action is needed and empty optional will be returned.- Parameters:
 oldEntry- the inventory entry that should be updatednewEntry- the inventory entry draft which contains new supply channel- Returns:
 - optional containing update action or empty optional if supply channels are identical
 
 
 - 
 
 -