Started with the separated DB with the given code
[RRRRHHHH_Code] / ruralHousesDB / src / domain / Account.java
1 package domain;
2
3 import java.io.Serializable;
4 import java.util.Arrays;
5
6
7 public class Account implements Serializable {
8
9         /**
10          * 
11          */
12         private static final long serialVersionUID = 1L;
13         
14
15         private byte[] username;
16         private byte[] password;
17         private byte[] salt;
18
19
20         private Owner owner;
21         private boolean admin = false;
22
23         public Account(byte[] usr){
24         
25                 
26         }
27         public Account(String usr, String pass, boolean isAdmin) {
28                 
29
30         }
31
32         public Account(String usr, String pass, Owner ow) {
33                 
34
35         }
36
37
38         
39
40         public byte[] getUsername() {
41                 return username;
42         }
43
44         public byte[] getPassword() {
45                 return password;
46         }
47
48         public Owner getOwner() {
49                 return owner;
50         }
51
52         public boolean getAdmin() {
53                 return admin;
54         }
55
56         
57         public void setAdmin(boolean admin) {
58                 this.admin = admin;
59         }
60
61         public byte[] getSalt() {
62                 return salt;
63         }
64
65         public void setSalt(byte[] salt) {
66                 this.salt = salt;
67         }
68         
69
70         @Override
71         public boolean equals(Object obj) {
72                 if (this == obj)
73                         return true;
74                 if (obj == null)
75                         return false;
76                 if (getClass() != obj.getClass())
77                         return false;
78                 Account other = (Account) obj;
79                 if (!Arrays.equals(username, other.username))
80                         return false;
81                 return true;
82         }
83
84 }