-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathItem.java
More file actions
89 lines (82 loc) · 2.29 KB
/
Item.java
File metadata and controls
89 lines (82 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.booleanuk.core;
public abstract class Item {
private SKU sku;
private float price;
private String type;
private String variant;
public Item(SKU sku) {
this.sku = sku;
// Set price, type, and variant based on SKU
if (sku == SKU.BGLO) {
price = 0.49f;
type = "Bagel";
variant = "Onion";
} else if (sku == SKU.BGLP) {
price = 0.39f;
type = "Bagel";
variant = "Plain";
} else if (sku == SKU.BGLE) {
price = 0.49f;
type = "Bagel";
variant = "Everything";
} else if (sku == SKU.BGLS) {
price = 0.49f;
type = "Bagel";
variant = "Sesame";
} else if (sku == SKU.COFB) {
price = 0.99f;
type = "Coffee";
variant = "Black";
} else if (sku == SKU.COFW) {
price = 1.19f;
type = "Coffee";
variant = "White";
} else if (sku == SKU.COFC) {
price = 1.29f;
type = "Coffee";
variant = "Capuccino";
} else if (sku == SKU.COFL) {
price = 1.29f;
type = "Coffee";
variant = "Latte";
} else if (sku == SKU.FILB) {
price = 0.12f;
type = "Filling";
variant = "Bacon";
} else if (sku == SKU.FILE) {
price = 0.12f;
type = "Filling";
variant = "Egg";
} else if (sku == SKU.FILC) {
price = 0.12f;
type = "Filling";
variant = "Cheese";
} else if (sku == SKU.FILX) {
price = 0.12f;
type = "Filling";
variant = "Cream Cheese";
} else if (sku == SKU.FILS) {
price = 0.12f;
type = "Filling";
variant = "Smoked Salmon";
} else if (sku == SKU.FILH) {
price = 0.12f;
type = "Filling";
variant = "Ham";
} else {
throw new IllegalArgumentException("Invalid SKU: " + sku);
}
}
SKU getSku() {
return sku;
}
float getPrice() {
return price;
}
String getType() {
return type;
}
String getVariant() {
return variant;
}
}