-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathItem.java
More file actions
39 lines (32 loc) · 838 Bytes
/
Item.java
File metadata and controls
39 lines (32 loc) · 838 Bytes
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
public class Item {
private final Food food;
private final int count;
private final String description;
public Item(Food food, int count) {
this.food = food;
this.count = count;
this.description = "_"; // Empty description
}
public Item(Food food, int count, String description) {
this.food = food;
this.count = count;
this.description = description;
}
public Food getFood() {
return food;
}
public int getCount() {
return count;
}
public String getDescription() {
return description;
}
@Override
public String toString() {
return "Item{" +
"food=" + food +
", count=" + count +
", description='" + description +
"'}";
}
}