SalesPoint Framework v3.1

data
Class DataBasketConditionImpl

java.lang.Object
  extended bydata.DataBasketConditionImpl
All Implemented Interfaces:
DataBasketCondition, DataBasketKeys, Serializable

public class DataBasketConditionImpl
extends Object
implements DataBasketCondition

Basic implementation of the DataBasketCondition interface. You can use this class as a basis for implementing more sophisticated queries.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Field Summary
static DataBasketCondition ALL_CATALOG_ITEMS
          A DataBasketCondition that matches all entries that describe CatalogItem movements.
static DataBasketCondition ALL_ENTRIES
          A DataBasketCondition matching all items in a DataBasket.
static DataBasketCondition ALL_STOCK_ITEMS
          A DataBasketCondition that matches all entries that describe StockItem movements.
protected  DataBasketEntryDestination m_dbedDest
          The destination condition.
protected  DataBasketEntrySource m_dbesSource
          The source condition.
protected  Object m_oValue
          The value condition.
protected  String m_sMainKey
          The main key condition.
protected  String m_sSecondaryKey
          The secondary key condition.
 
Fields inherited from interface data.DataBasketKeys
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY
 
Constructor Summary
DataBasketConditionImpl(String sMainKey, String sSecondaryKey, DataBasketEntrySource dbesSource, DataBasketEntryDestination dbedDest, Object oValue)
          Create a new DataBasketConditionImpl.
 
Method Summary
static DataBasketCondition allCatalogItemsWithDest(Catalog cDest)
          A DataBasketCondition that matches all entries that describe CatalogItems being entered into the given Catalog.
static DataBasketCondition allCatalogItemsWithSource(Catalog cSource)
          A DataBasketCondition that matches all entries that describe CatalogItems being taken from the given Catalog.
static DataBasketCondition allStockItemsWithDest(Stock stDest)
          A DataBasketCondition that matches all entries that describe StockItems being entered into the given Stock.
static DataBasketCondition allStockItemsWithSource(Stock stSource)
          A DataBasketCondition that matches all entries that describe StockItems being taken from the given Stock.
 DataBasketEntryDestination getDestination()
          Return the destination for operations that match the condition.
 String getMainKey()
          Return the main key that DataBasketEntries must have to match the condition.
 String getSecondaryKey()
          Return the secondary key that DataBasketEntries must have to match the condition.
 DataBasketEntrySource getSource()
          Return the source for operations that match the condition.
 Object getValue()
          Return the object for operations that match the condition.
 boolean match(DataBasketEntry dbe)
          As a default, always returns true.
static DataBasketCondition specificCatalogItem(CatalogItem ci)
          A DataBasketCondition that matches exactly one given CatalogItem.
static DataBasketCondition specificStockItem(StockItem si)
          A DataBasketCondition that matches exactly one given StockItem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_dbesSource

protected DataBasketEntrySource m_dbesSource
The source condition.


m_dbedDest

protected DataBasketEntryDestination m_dbedDest
The destination condition.


m_sMainKey

protected String m_sMainKey
The main key condition.


m_sSecondaryKey

protected String m_sSecondaryKey
The secondary key condition.


m_oValue

protected Object m_oValue
The value condition.


ALL_ENTRIES

public static final DataBasketCondition ALL_ENTRIES
A DataBasketCondition matching all items in a DataBasket.


ALL_STOCK_ITEMS

public static final DataBasketCondition ALL_STOCK_ITEMS
A DataBasketCondition that matches all entries that describe StockItem movements.


ALL_CATALOG_ITEMS

public static final DataBasketCondition ALL_CATALOG_ITEMS
A DataBasketCondition that matches all entries that describe CatalogItem movements.

Constructor Detail

DataBasketConditionImpl

public DataBasketConditionImpl(String sMainKey,
                               String sSecondaryKey,
                               DataBasketEntrySource dbesSource,
                               DataBasketEntryDestination dbedDest,
                               Object oValue)
Create a new DataBasketConditionImpl.

Parameters:
sMainKey - the value for m_sMainKey.
sSecondaryKey - the value for m_sSecondaryKey.
dbesSource - the value for m_dbesSource.
dbedDest - the value for m_dbedDest.
oValue - the value for m_oValue.
Method Detail

getSource

public DataBasketEntrySource getSource()
Description copied from interface: DataBasketCondition
Return the source for operations that match the condition. Returning null means any source, other values mean exactly what they say, i.e. they are tested for identity.

Specified by:
getSource in interface DataBasketCondition
Returns:
m_dbesSource.
Override:
Never Instead set the value of m_dbesSource.

getDestination

public DataBasketEntryDestination getDestination()
Description copied from interface: DataBasketCondition
Return the destination for operations that match the condition. Returning null means any destination, other values mean exactly what they say, i.e. they are tested for identity.

Specified by:
getDestination in interface DataBasketCondition
Returns:
m_dbedDest.
Override:
Never Instead set the value of m_dbedDest.

getValue

public Object getValue()
Description copied from interface: DataBasketCondition
Return the object for operations that match the condition. Returning null means check each DataBasketEntry by calling match(), other values mean exactly what they say, i.e. they are tested for identity.

Specified by:
getValue in interface DataBasketCondition
Returns:
m_oValue.
Override:
Never Instead set the value of m_oValue.

getMainKey

public String getMainKey()
Description copied from interface: DataBasketCondition
Return the main key that DataBasketEntries must have to match the condition. Returning null means any main key.

Specified by:
getMainKey in interface DataBasketCondition
Returns:
m_sMainKey.
Override:
Never Instead set the value of m_sMainKey.

getSecondaryKey

public String getSecondaryKey()
Description copied from interface: DataBasketCondition
Return the secondary key that DataBasketEntries must have to match the condition. Returning null means any secondary key.

Specified by:
getSecondaryKey in interface DataBasketCondition
Returns:
m_sSecondaryKey.
Override:
Never Instead set the value of m_sSecondaryKey.

match

public boolean match(DataBasketEntry dbe)
As a default, always returns true.

Specified by:
match in interface DataBasketCondition
Override:
Sometimes

allStockItemsWithSource

public static final DataBasketCondition allStockItemsWithSource(Stock stSource)
A DataBasketCondition that matches all entries that describe StockItems being taken from the given Stock.


allStockItemsWithDest

public static final DataBasketCondition allStockItemsWithDest(Stock stDest)
A DataBasketCondition that matches all entries that describe StockItems being entered into the given Stock.


allCatalogItemsWithSource

public static final DataBasketCondition allCatalogItemsWithSource(Catalog cSource)
A DataBasketCondition that matches all entries that describe CatalogItems being taken from the given Catalog.


allCatalogItemsWithDest

public static final DataBasketCondition allCatalogItemsWithDest(Catalog cDest)
A DataBasketCondition that matches all entries that describe CatalogItems being entered into the given Catalog.


specificCatalogItem

public static final DataBasketCondition specificCatalogItem(CatalogItem ci)
A DataBasketCondition that matches exactly one given CatalogItem.


specificStockItem

public static final DataBasketCondition specificStockItem(StockItem si)
A DataBasketCondition that matches exactly one given StockItem.


SalesPoint Framework v3.1