BowlerKernel
PurchasingData.java
Go to the documentation of this file.
1 package com.neuronrobotics.bowlerstudio.vitamins;
2 
3 import java.util.HashMap;
4 
5 public class PurchasingData {
6 
7  private HashMap<String, Double> variantParameters;
8  private HashMap<Integer, Double> pricsUSD;
9  private String urlAPI;
10  private String db;
11  private String serverType;
12  private String cartURL;
13 
14  public PurchasingData() {
15  variantParameters = new HashMap<>();
16  variantParameters.put("Bolt Length", 10.0);
17  pricsUSD = new HashMap<>();
18  pricsUSD.put(1, 0.02);
19  urlAPI = "http://localhost:8069/";
20  db = "testdatabse";
21  serverType = "odoo";
22  cartURL = "http://localhost:8069/shop/product/m3-socket-cap-screw-73";
23  }
24 
25  public HashMap<String, Double> getVariantParameters() {
26  return variantParameters;
27  }
28 
29  public void setVariantParameters(HashMap<String, Double> variantParameters) {
30  this.variantParameters = variantParameters;
31  }
32 
33  public double getPricsUSD(int qty) {
34  return pricsUSD.get(qty);
35  }
36 
37  public void setPricsUSD(int qty, double pricsUSD) {
38  this.pricsUSD.put(qty, pricsUSD);
39  }
40 
41  public String getAPIUrl() {
42  return urlAPI;
43  }
44 
45  public void setAPIUrl(String url) {
46  this.urlAPI = url;
47  }
48 
49  public String getDatabase() {
50  return db;
51  }
52 
53  public void setDatabase(String db) {
54  this.db = db;
55  }
56 
57  public String getServerType() {
58  return serverType;
59  }
60 
61  public void setServerType(String serverType) {
62  this.serverType = serverType;
63  }
64 
65  public String getCartUrl() {
66  return cartURL;
67  }
68 
69  public void setCartUrl(String cartURL) {
70  this.cartURL = cartURL;
71  }
72 
73  @Override
74  public String toString() {
75  String s = "\n";
76  s += "urlAPI " + urlAPI + "\n";
77  s += "db " + db + "\n";
78  s += "serverType " + serverType + "\n";
79  s += "cartURL " + cartURL + "\n";
80  for (String key : variantParameters.keySet()) {
81  s += "variable " + key + " to " + variantParameters.get(key) + "\n";
82  }
83  for (Integer key : pricsUSD.keySet()) {
84  s += "Price at " + key + " = " + pricsUSD.get(key) + "\n";
85  }
86 
87  return s;
88  }
89 
90 }
void setVariantParameters(HashMap< String, Double > variantParameters)