-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.java
66 lines (53 loc) · 1.16 KB
/
User.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
public class User {
private String name;
private String password;
private IDStuff id;
public User(String name, String password) {
this.name = name;
this.password = password;
id = null;
}
public User(String name, String password, IDStuff id) {
this.name = name;
this.password = password;
this.id = id;
}
public User(User other) {
this.name = other.name;
this.password = other.password;
this.id = other.id;
}
public String getName() {
return name;
}
public String getPassword() {
return password;
}
public void setId(IDStuff id) {
this.id = id;
}
public boolean equals(Object other) {
if(this == other) {
return true;
}
if(!(other instanceof User)) {
return false;
}
User u = (User) other;
return (this.name.equals(u.name)) && (this.password.equals(u.password));
}
public boolean process(User other) {
if(!(this.equals(other))) {
return false;
}
if(this.id.comparer(other.id)) {
return true;
}
else {
return false;
}
}
public String toString() {
return "Username: "+name+" Password: "+password+ " ID: "+id;
}
}