org.broadleafcommerce.core.inventory.domain
Class SkuAvailabilityImpl

java.lang.Object
  extended by org.broadleafcommerce.core.inventory.domain.SkuAvailabilityImpl
All Implemented Interfaces:
Serializable, SkuAvailability

@Entity
public class SkuAvailabilityImpl
extends Object
implements SkuAvailability

The Class SkuAvailabilityImpl is the default implementation of SkuAvailability.

This class is retrieved using the AvailabilityService. The service allows availability to be be location specific (e.g. for store specific inventory availability)

This implementation uses a Hibernate implementation of JPA configured through annotations. The Entity references the following tables: BLC_SKU_AVAILABILITY

Author:
bpolster
See Also:
Sku}, Serialized Form

Field Summary
protected  Date availabilityDate
          The date this product will be available.
protected  String availabilityStatus
          The description.
protected  Long id
          The id.
protected  Long locationId
          The retail price.
protected  Integer quantityOnHand
          The quantity on hand.
protected  Integer reserveQuantity
          The reserve quantity.
protected  Long skuId
          The sale price.
 
Constructor Summary
SkuAvailabilityImpl()
           
 
Method Summary
 boolean equals(Object obj)
           
 Date getAvailabilityDate()
          Returns the data the SKU will be available.
 AvailabilityStatusType getAvailabilityStatus()
          Returns an implementation specific availability status.
 Integer getAvailableQuantity()
          Returns the getQuantityOnHand() - getReserveQuantity().
 Long getId()
          Returns the id of this SkuAvailability
 Long getLocationId()
          Returns the USPSLocation id of this skuAvailability.
 Integer getQuantityOnHand()
          Returns the number of this items that are currently in stock and available for sell.
 Integer getReserveQuantity()
          Returns the reserve quantity.
 Long getSkuId()
          Returns the id of this SKU associated with SkuAvailability record
 int hashCode()
           
 void setAvailabilityDate(Date availabilityDate)
          Sets the date the SKU will be available.
 void setAvailabilityStatus(AvailabilityStatusType availabilityStatus)
          Sets the availability status.
 void setId(Long id)
          Sets the id of this SkuAvailability record
 void setLocationId(Long locationId)
          Sets the USPSLocation id of this skuAvailability.
 void setQuantityOnHand(Integer qoh)
          Sets the quantity on hand.
 void setReserveQuantity(Integer reserveQuantity)
          Sets the reserve quantity.
 void setSkuId(Long skuId)
          Sets the id of this SKU
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id
The id.


skuId

protected Long skuId
The sale price.


locationId

protected Long locationId
The retail price.


quantityOnHand

protected Integer quantityOnHand
The quantity on hand.


reserveQuantity

protected Integer reserveQuantity
The reserve quantity.


availabilityStatus

protected String availabilityStatus
The description.


availabilityDate

protected Date availabilityDate
The date this product will be available.

Constructor Detail

SkuAvailabilityImpl

public SkuAvailabilityImpl()
Method Detail

getId

public Long getId()
Description copied from interface: SkuAvailability
Returns the id of this SkuAvailability

Specified by:
getId in interface SkuAvailability

getLocationId

public Long getLocationId()
Description copied from interface: SkuAvailability
Returns the USPSLocation id of this skuAvailability. SKU availability records may or may not be location specific and using null locations are a common implementation model.

Specified by:
getLocationId in interface SkuAvailability

getQuantityOnHand

public Integer getQuantityOnHand()
Description copied from interface: SkuAvailability
Returns the number of this items that are currently in stock and available for sell. Returning null has an implementation specific meaning.

Specified by:
getQuantityOnHand in interface SkuAvailability

getSkuId

public Long getSkuId()
Description copied from interface: SkuAvailability
Returns the id of this SKU associated with SkuAvailability record

Specified by:
getSkuId in interface SkuAvailability

setId

public void setId(Long id)
Description copied from interface: SkuAvailability
Sets the id of this SkuAvailability record

Specified by:
setId in interface SkuAvailability

setLocationId

public void setLocationId(Long locationId)
Description copied from interface: SkuAvailability
Sets the USPSLocation id of this skuAvailability. SKU availability records may or may not be location specific and using null locations are a common implementation model.

Specified by:
setLocationId in interface SkuAvailability

setQuantityOnHand

public void setQuantityOnHand(Integer qoh)
Description copied from interface: SkuAvailability
Sets the quantity on hand. Setting to null is allowed and has an implementation specific meaning.

Specified by:
setQuantityOnHand in interface SkuAvailability

setSkuId

public void setSkuId(Long skuId)
Description copied from interface: SkuAvailability
Sets the id of this SKU

Specified by:
setSkuId in interface SkuAvailability

getAvailabilityDate

public Date getAvailabilityDate()
Description copied from interface: SkuAvailability
Returns the data the SKU will be available. This property may return null which has an implementation specific meaning.

Specified by:
getAvailabilityDate in interface SkuAvailability

setAvailabilityDate

public void setAvailabilityDate(Date availabilityDate)
Description copied from interface: SkuAvailability
Sets the date the SKU will be available. Setting to null is allowed and has an implementation specific meaning.

Specified by:
setAvailabilityDate in interface SkuAvailability

getAvailabilityStatus

public AvailabilityStatusType getAvailabilityStatus()
Description copied from interface: SkuAvailability
Returns an implementation specific availability status. This property can return null.

Specified by:
getAvailabilityStatus in interface SkuAvailability

setAvailabilityStatus

public void setAvailabilityStatus(AvailabilityStatusType availabilityStatus)
Description copied from interface: SkuAvailability
Sets the availability status.

Specified by:
setAvailabilityStatus in interface SkuAvailability

getReserveQuantity

public Integer getReserveQuantity()
Returns the reserve quantity. Nulls will be treated the same as 0. Implementations may want to manage a reserve quantity at each location so that the available quantity for purchases is the quantityOnHand - reserveQuantity.

Specified by:
getReserveQuantity in interface SkuAvailability

setReserveQuantity

public void setReserveQuantity(Integer reserveQuantity)
Sets the reserve quantity. Implementations may want to manage a reserve quantity at each location so that the available quantity for purchases is the quantityOnHand - reserveQuantity.

Specified by:
setReserveQuantity in interface SkuAvailability

getAvailableQuantity

public Integer getAvailableQuantity()
Returns the getQuantityOnHand() - getReserveQuantity(). Preferred implementation is to return null if getQuantityOnHand() is null and to treat a null in getReserveQuantity() as ZERO.

Specified by:
getAvailableQuantity in interface SkuAvailability

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.