01: package de.schlund.pfixcore.example.bank.model;
02:
03: import java.util.List;
04:
05: public class Customer {
06:
07: private long customerId;
08: private String firstName;
09: private String lastName;
10: private String password;
11: private List<Account> accounts;
12:
13: public Customer(long customerId, String firstName, String lastName,
14: String password) {
15: this .customerId = customerId;
16: this .firstName = firstName;
17: this .lastName = lastName;
18: this .password = password;
19: }
20:
21: public long getCustomerId() {
22: return customerId;
23: }
24:
25: public void setCustomerId(long customerId) {
26: this .customerId = customerId;
27: }
28:
29: public String getFirstName() {
30: return firstName;
31: }
32:
33: public void setFirstName(String firstName) {
34: this .firstName = firstName;
35: }
36:
37: public String getLastName() {
38: return lastName;
39: }
40:
41: public void setLastName(String lastName) {
42: this .lastName = lastName;
43: }
44:
45: public String getPassword() {
46: return password;
47: }
48:
49: public void setPassword(String password) {
50: this .password = password;
51: }
52:
53: public List<Account> getAccounts() {
54: return accounts;
55: }
56:
57: public Account getAccountByNo(long no) {
58: for (Account account : accounts) {
59: if (account.getAccountNo() == no)
60: return account;
61: }
62: return null;
63: }
64:
65: public void setAccounts(List<Account> accounts) {
66: this.accounts = accounts;
67: }
68:
69: }
|