@Entity public class InventoryItem extends AbstractEntity<InventoryItemIdentifier>
| Modifier | Constructor and Description |
|---|---|
protected |
InventoryItem()
Deprecated.
|
|
InventoryItem(Product product,
Quantity quantity)
|
| Modifier and Type | Method and Description |
|---|---|
void |
decreaseQuantity(Quantity quantity)
Decreases the quantity of the current
InventoryItem by the given Quantity. |
InventoryItemIdentifier |
getIdentifier()
Returns the
SalespointIdentifier. |
Product |
getProduct() |
Quantity |
getQuantity() |
boolean |
hasSufficientQuantity(Quantity quantity)
Returns whether the
InventoryItem is available in exactly or more of the given quantity. |
void |
increaseQuantity(Quantity quantity)
Increases the quantity of the current
InventoryItem by the given Quantity. |
equals, getId, hashCode, isNew@Deprecated protected InventoryItem()
public InventoryItem(Product product, Quantity quantity)
product - the Product for this InventoryItem, must not be null.quantity - the initial Quantity for this InventoryItem, must not be null.public final InventoryItemIdentifier getIdentifier()
AbstractEntitySalespointIdentifier.getIdentifier in class AbstractEntity<InventoryItemIdentifier>public final Quantity getQuantity()
public final Product getProduct()
public boolean hasSufficientQuantity(Quantity quantity)
InventoryItem is available in exactly or more of the given quantity.quantity - must not be null.public void decreaseQuantity(Quantity quantity)
InventoryItem by the given Quantity.quantity - must not be null.public void increaseQuantity(Quantity quantity)
InventoryItem by the given Quantity.quantity - must not be null.Copyright © 2014 Pivotal Software, Inc.. All rights reserved.