View Javadoc
1   /*
2    * Copyright (c) Patrick Magauran 2018.
3    *   Licensed under the AGPLv3. All conditions of said license apply.
4    *       This file is part of ABOS.
5    *
6    *       ABOS is free software: you can redistribute it and/or modify
7    *       it under the terms of the GNU Affero General Public License as published by
8    *       the Free Software Foundation, either version 3 of the License, or
9    *       (at your option) any later version.
10   *
11   *       ABOS is distributed in the hope that it will be useful,
12   *       but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *       GNU Affero General Public License for more details.
15   *
16   *       You should have received a copy of the GNU Affero General Public License
17   *       along with ABOS.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  package Utilities;
21  
22  import javafx.beans.property.SimpleIntegerProperty;
23  import javafx.beans.property.SimpleObjectProperty;
24  import javafx.beans.property.SimpleStringProperty;
25  
26  import java.math.BigDecimal;
27  
28  public class formattedProductProps {
29  
30      public final SimpleIntegerProperty productKey = new SimpleIntegerProperty();
31  
32      public final SimpleObjectProperty<BigDecimal> productUnitPrice = new SimpleObjectProperty<>();
33  
34      public final SimpleStringProperty productUnitPriceString = new SimpleStringProperty();
35  
36      public final SimpleStringProperty productID = new SimpleStringProperty();
37  
38      public final SimpleStringProperty productName = new SimpleStringProperty();
39      public final SimpleStringProperty productSize = new SimpleStringProperty();
40      public final SimpleObjectProperty<BigDecimal> extendedCost = new SimpleObjectProperty();
41      public final SimpleStringProperty productCategory = new SimpleStringProperty();
42      public final SimpleStringProperty orderedQuantityString = new SimpleStringProperty();
43      public final SimpleIntegerProperty orderedQuantity = new SimpleIntegerProperty();
44  
45      public formattedProductProps(int ProductKey, String productID, String productName, String productSize, BigDecimal productUnitPrice, String productCategory, int orderedQuantity, BigDecimal extendedCost) {
46          this.productKey.set(ProductKey);
47          this.productID.set(productID);
48          this.productName.set(productName);
49          this.productSize.set(productSize);
50          this.productUnitPrice.set(productUnitPrice);
51          this.productUnitPriceString.set(productUnitPrice.toPlainString());
52          this.productCategory.set(productCategory);
53          this.orderedQuantity.set(orderedQuantity);
54          this.orderedQuantityString.set(String.valueOf(orderedQuantity));
55          this.extendedCost.set(extendedCost);
56      }
57  
58      public SimpleIntegerProperty productKeyProperty() {
59          return productKey;
60      }
61  
62      public int getProductKey() {
63          return productKey.get();
64      }
65  
66      public void setProductKey(int productKey) {
67          this.productKey.set(productKey);
68      }
69  
70      public String getProductID() {
71          return productID.get();
72      }
73  
74      public void setProductID(String productID) {
75          this.productID.set(productID);
76      }
77  
78      public String getProductName() {
79          return productName.get();
80      }
81  
82      public void setProductName(String productName) {
83          this.productName.set(productName);
84      }
85  
86      public String getProductSize() {
87          return productSize.get();
88      }
89  
90      public void setProductSize(String productSize) {
91          this.productSize.set(productSize);
92      }
93  
94      public BigDecimal getProductUnitPrice() {
95          return productUnitPrice.get();
96      }
97  
98      public void setProductUnitPrice(BigDecimal productUnitPrice) {
99          this.productUnitPrice.set(productUnitPrice);
100     }
101 
102     public String getProductCategory() {
103         return productCategory.get();
104     }
105 
106     public void setProductCategory(String productCategory) {
107         this.productCategory.set(productCategory);
108     }
109 
110     public int getOrderedQuantity() {
111         return orderedQuantity.get();
112     }
113 
114     public void setOrderedQuantity(int orderedQuantity) {
115         this.orderedQuantity.set(orderedQuantity);
116     }
117 
118     public String getProductUnitPriceString() {
119         return productUnitPriceString.get();
120     }
121 
122     public void setProductUnitPriceString(String productUnitPriceString) {
123         this.productUnitPriceString.set(productUnitPriceString);
124     }
125 
126     public String getOrderedQuantityString() {return orderedQuantityString.get();}
127 
128     public void setOrderedQuantityString(String orderedQuantityString) {
129         this.orderedQuantityString.set(orderedQuantityString);
130     }
131 
132     public BigDecimal getExtendedCost() {
133         return extendedCost.get();
134     }
135 
136     public void setExtendedCost(BigDecimal extendedCost) {
137         this.extendedCost.set(extendedCost);
138     }
139 }