-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer.java
42 lines (37 loc) · 1.17 KB
/
Customer.java
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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author asus
*/
import java.util.ArrayList;
public class Customer {
private String password;
private String username;
private int customerId;
ArrayList<Order> orders = new ArrayList<Order>();
public Customer(int customerId,String username, String password){
this.customerId = customerId;
this.password = password;
this.username = username;
}
public boolean Login(String username, String password){
if(this.username.equals(username)){
if(this.password.equals(password)){
return true;
}
}
return false;
}
public ArrayList<Order> viewOrderHistory(){
return orders;
}
public void addOrder(Order order){
orders.add(order);
}
public int getCustomerId(){return this.customerId;}
public String getUsername(){return this.username;}
public String getPassword(){return this.password;}
}