-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrder.java
More file actions
64 lines (45 loc) · 1.54 KB
/
Order.java
File metadata and controls
64 lines (45 loc) · 1.54 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
package oopprojecthalilkayra;
public class Order {
//Sepetteki her ürün için ayrı bir Order objesi oluşturulacak
//okey bu class'ta sorun yok bence
private User orderingUser;
private Product orderedProduct;
private CreditCard paymentCard;
private int orderAmount;
// constructor
public Order(User user, Product orderedProduct, int amount, CreditCard paymentCard){
this.orderingUser = user;
this.orderedProduct = orderedProduct;
this.orderAmount = amount;
this.paymentCard = paymentCard;
}
// getters and setters
public User getOrderingUser() {
return orderingUser;
}
public void setOrderingUser(User orderingUser) {
this.orderingUser = orderingUser;
}
public Product getOrderedProduct() {
return orderedProduct;
}
public void setOrderedProduct(Product orderedProduct) {
this.orderedProduct = orderedProduct;
}
public CreditCard getPaymentCard() {
return paymentCard;
}
public void setPaymentCard(CreditCard paymentCard) {
this.paymentCard = paymentCard;
}
public int getOrderAmount() {
return orderAmount;
}
public void setOrderAmount(int orderAmount) {
this.orderAmount = orderAmount;
}
// order class'ındaki method
public void createOrder(){
this.getOrderingUser().confirmOrder(this);
}
}