]> git.mxchange.org Git - jcustomer-core.git/blob - src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java
More cleanup
[jcustomer-core.git] / src / org / mxchange / jshopcore / model / product / generic / 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.generic;
18
19 import java.text.MessageFormat;
20 import org.mxchange.jshopcore.model.product.BaseProduct;
21 import org.mxchange.jshopcore.model.product.Product;
22
23 /**
24  * Generic product class
25  *
26  * @author Roland Haeder
27  * TODO: Find a better name
28  */
29 public class GenericProduct extends BaseProduct implements Product {
30         /**
31          * Serial number
32          */
33         private static final long serialVersionUID = 54_578_571_769_283L;
34
35         /**
36          * Default constructor
37          */
38         public GenericProduct () {
39         }
40
41         /**
42          * Constructor will all required data
43          *
44          * @param id Id number of product
45          * @param title Name of product
46          * @param price Price
47          * @param categoryId Category id
48          * @param available Availability (selectable by customer)
49          */
50         public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) {
51                 // Trace message
52                 this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N
53
54                 // Set all here
55                 this.setItemId(id);
56                 this.setTitle(title);
57                 this.setPrice(price);
58                 this.setCategoryId(categoryId);
59                 this.setAvailable(available);
60         }
61 }