001 package org.cocome.tradingsystem.systests.util; 002 003 004 /** 005 * Simple storage class for generated products. 006 * 007 * @author Benjamin Hummel 008 * @author Christian Pfaller 009 * @author $Author: pfaller $ 010 * @version $Rev: 60 $ 011 * @levd.rating GREEN Rev: 60 012 */ 013 public final class GeneratedStockItem { 014 015 /** The product this item is from. */ 016 final GeneratedProduct product; 017 018 /** The sales price in cents. */ 019 final int salesPrice; 020 021 /** The amount currently on stock. */ 022 final int amount; 023 024 /** The amount theat should be at least available in the store. */ 025 final int minAmount; 026 027 /** The amount theat could be at maximum in the store. */ 028 final int maxAmount; 029 030 /** 031 * Create a new instance. This has package visibility, as it should only be 032 * generated by the StockGenerator. 033 */ 034 GeneratedStockItem(GeneratedProduct product, int salesPrice, 035 int amount, int minAmount, int maxAmount) { 036 this.product = product; 037 this.salesPrice = salesPrice; 038 this.amount = amount; 039 this.minAmount = minAmount; 040 this.maxAmount = maxAmount; 041 } 042 043 /** Returns the amount currently on stock. */ 044 public int getAmount() { 045 return amount; 046 } 047 048 /** Returns the amount theat should be at least available in the store. */ 049 public int getMinAmount() { 050 return minAmount; 051 } 052 053 /** Returns the product this item is from. */ 054 public GeneratedProduct getProduct() { 055 return product; 056 } 057 058 /** Returns the sales price in cents. */ 059 public int getSalesPrice() { 060 return salesPrice; 061 } 062 063 /** 064 * Returns the maximum amount of products possible to keep in stock 065 */ 066 public int getMaxAmount() { 067 return maxAmount; 068 } 069 070 }