001 package data;
002
003 /**
004 * Identifier class for Stocks. This can be used for getting correctly typed
005 * Stocks from the shop using it's {@link sale.Shop#getStock(StockIdentifier) getStock()}
006 * method. Thus, a StockIdentifier is a combination of a name and the two type parameters
007 * a Stock posseses.
008 *
009 * @author Thomas Ryssel
010 * @since 3.3
011 *
012 * @param <T> The type of stock item that is associated to the Stock identified.
013 * @param <CT> The type of catalog item that is associated to the Catalog that is
014 * associated to the Stock identified.
015 */
016 public class StockIdentifier<T extends StockItem, CT extends CatalogItem> {
017
018 /**
019 * Identifier name.
020 */
021 private String m_sName;
022
023 /**
024 * Create a new StockIdentifer.
025 *
026 * @param name Identifier name.
027 */
028 public StockIdentifier(String name) {
029 m_sName = name;
030 }
031
032 /**
033 * Get the identifier name.
034 *
035 * @return Identifier name.
036 */
037 public String getName() {
038 return m_sName;
039 }
040 }