001    package org.cocome.tradingsystem.systests.util;
002    
003    import org.cocome.tradingsystem.systests.interfaces.IProduct;
004    
005    /**
006     * Simple storage class for generated products.
007     * 
008     * @author Benjamin Hummel
009     * @author Christian Pfaller
010     * @author $Author: hummel $
011     * @version $Rev: 60 $
012     * @levd.rating GREEN Rev: 60
013     */
014    public final class GeneratedProduct {
015    
016            /** The barcode of the product. */
017            final int barcode;
018    
019            /** The purchase price of the product in cents. */
020            final int purchasePrice;
021    
022            /** The name of the product. */
023            final String name;
024    
025            /** The product itself. */
026            final IProduct product;
027    
028            /**
029             * Create a new instance. This has package visibility, as it should only be
030             * generated by the StockGenerator.
031             */
032            /* package */GeneratedProduct(int barcode, int purchasePrice, String name,
033                            IProduct product) {
034                    this.barcode = barcode;
035                    this.purchasePrice = purchasePrice;
036                    this.name = name;
037                    this.product = product;
038            }
039    
040            /** Returns the barcode. */
041            public int getBarcode() {
042                    return barcode;
043            }
044    
045            /** Returns the name. */
046            public String getName() {
047                    return name;
048            }
049    
050            /** Returns the product. */
051            public IProduct getProduct() {
052                    return product;
053            }
054    
055            /** Returns the purchase price in cents. */
056            public int getPurchasePrice() {
057                    return purchasePrice;
058            }
059    }