-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
75 lines (75 loc) · 1.87 KB
/
User.java
File metadata and controls
75 lines (75 loc) · 1.87 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package PAT;
import java.sql.*;
import javax.swing.*;
/*
Class user
Stores the info of an individual user
*/
public class User {
//User details
private String username = "";
private String userType = "";
private String pw = "";
private String uName = "";
private String uSurname = "";
private boolean active = true;
/*
Constructor method
Creates an object of the class with all the data provided
@parameters: String username, String user type, String password, String name, String surname, boolean is user active
@return: none
*/
public User(String _username, String _userType, String _pw, String _uName, String _uSurname, boolean _active){
username = _username;
userType = _userType;
pw = _pw;
uName = _uName;
uSurname = _uSurname;
active = _active;
}
/*
Method getUsername
Accessor Method for the username
@parameters: none
@return: String username
*/
public String getUsername(){
return username;
}
/*
Method getPassword
AccesorMethod to get the password
@parameters: none
@return: String password
*/
public String getPassword(){
return pw;
}
/*
Method isActive
Checks to see if user is active
@parameters: none
@return: boolean if user is active
*/
public boolean isActive(){
return active;
}
/*
Method getUserType
Accesor Method to get the userType
@parameters: none
@return: String user type
*/
public String getUserType(){
return userType;
}
/*
Method getInfo
Combines the user's name and surname in a single string
@parameters: none
@return: string fullname
*/
public String getInfo(){
return uName + " " + uSurname;
}
}