-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
42 lines (42 loc) · 1.19 KB
/
Copy pathUser.java
File metadata and controls
42 lines (42 loc) · 1.19 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
public class User {
protected String userId;
protected String name;
protected String email;
protected String phoneNumber;
protected String password;
protected String role;
public User(String userId, String name, String email, String phoneNumber, String password, String role){
this.userId = userId;
this.role = role;
this.name = name;
this.email = email;
this.phoneNumber = phoneNumber;
this.password = password;
}
public String getUserId(){
return this.userId;
}
public String getName(){
return this.name;
}
public String getEmail(){
return this.email;
}
public String getPhoneNumber(){
return this.phoneNumber;
}
public String getRole(){
return this.role;
}
public String[] authenticate(String password){
if(this.password.equals(password)){
return new String[]{this.userId, this.role};
}
else{
return null;
}
}
public String getUserInfo(){
return "User ID : " + this.userId + "\nName : " + this.name + "\nEmail : " + this.email + "\nPhone Number : " + this.phoneNumber;
}
}