DataHandlerForTestsTest added,
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / core / User.java
index 24b7339..e964628 100644 (file)
@@ -18,14 +18,17 @@ public class User {
        private String lastname;
 
        /**
-        * Contructor of already existing user in the system
-        * @param userName
-        * @param password
-        * @param mail
-        * @param name
-        * @param lastname
+        * Constructor for already existing user in the Datacontext
+        * Only to be used by DataHandler implementation!
+        * 
+        * @param userName              Username
+        * @param password              Encrypted password
+        * @param mail                  Mail
+        * @param name                  Name
+        * @param lastname              Lastname
         */
-       User(String userName, String password, String mail, String name, String lastname){
+       //TODO: Change constructor to package when DataHandlerForExcel is moved back to this package
+       public User(String userName, String password, String mail, String name, String lastname){
                this.userName = userName;
                this.password = password;
                this.mail = mail;
@@ -33,11 +36,18 @@ public class User {
                this.lastname = lastname;
        }
 
+       /**
+        * Normal constructor for new users created in the UserController
+        * 
+        * @param userName
+        * @param password
+        * @throws Exception
+        */
        public User(String userName, String password) throws Exception{
                if(userName == null) throw new IllegalArgumentException("Username must not be null");
                if(userName.length() < 4) throw new IllegalArgumentException("Username must have at least 4 characters");
                if(password == null) throw new IllegalArgumentException("Password must not be null");
-               
+
                this.userName = userName;
                this.password = Password.getSaltedHash(password);
        }