]> git.mxchange.org Git - jcustomer-core.git/blob - src/org/mxchange/jshopcore/model/product/GenericProduct.java
Continued:
[jcustomer-core.git] / src / org / mxchange / jshopcore / model / product / GenericProduct.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jshopcore.model.product;
18
19 import java.text.MessageFormat;
20 import org.mxchange.jshopcore.model.product.BaseProduct;
21 import org.mxchange.jshopcore.model.product.BaseProduct;
22 import org.mxchange.jshopcore.model.product.Product;
23 import org.mxchange.jshopcore.model.product.Product;
24
25 /**
26  * Generic product class
27  *
28  * @author Roland Haeder
29  * TODO: Find a better name
30  */
31 public class GenericProduct extends BaseProduct implements Product {
32         /**
33          * Serial number
34          */
35         private static final long serialVersionUID = 54_578_571_769_283L;
36
37         /**
38          * Default constructor
39          */
40         public GenericProduct () {
41         }
42
43         /**
44          * Constructor will all required data
45          *
46          * @param id Id number of product
47          * @param title Name of product
48          * @param price Price
49          * @param categoryId Category id
50          * @param available Availability (selectable by customer)
51          */
52         public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) {
53                 // Trace message
54                 this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N
55
56                 // Set all here
57                 this.setItemId(id);
58                 this.setTitle(title);
59                 this.setPrice(price);
60                 this.setCategoryId(categoryId);
61                 this.setAvailable(available);
62         }
63 }