-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathCart.java
More file actions
35 lines (27 loc) · 836 Bytes
/
Cart.java
File metadata and controls
35 lines (27 loc) · 836 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
package org.example.classes;
import org.example.annotation.Generatable;
import java.util.List;
import java.util.Map;
@Generatable
public class Cart {
private List<Product> items;
private Map<String, Product> products;
public Cart(List<Product> items,Map<String, Product> products) {
this.items = items;
this.products = products;
}
public List<Product> getItems() {
return items;
}
public void setItems(List<Product> items) {
this.items = items;
}
// Конструктор, методы добавления и удаления товаров, геттеры и другие методы
@Override
public String toString() {
return "Cart{" +
"items=" + items +
", products=" + products +
'}';
}
}