java-doc
authorMichael <Michael@Michael-LT.bfh.ch>
Tue, 24 Nov 2015 09:52:57 +0000 (10:52 +0100)
committerMichael <Michael@Michael-LT.bfh.ch>
Tue, 24 Nov 2015 09:52:57 +0000 (10:52 +0100)
src/main/java/ch/bfh/ti/srs/dataschema/User.java

index e25dacb..859938f 100644 (file)
@@ -21,14 +21,14 @@ public class User implements Cloneable{
        private Set<Permissions> permissions;
 
        /**
-        * Constructor for already existing user in the Datacontext
-        * Only to be used by DataHandler implementation!
+        * Constructor for already existing <code>User</code> in the Datacontext.
+        * Only to be used by <code>DataHandler</code> implementation!
         * 
-        * @param userName                      Username
-        * @param hashedPassword        Encrypted password
-        * @param mail                          Mail
-        * @param name                          Name
-        * @param lastname                      Lastname
+        * @param userName                      user name
+        * @param hashedPassword        encrypted password
+        * @param mail                          mail
+        * @param name                          name
+        * @param lastname                      last name
         */
        //TODO: Change constructor to package when DataHandlerForExcel is moved back to this package
        public User(String userName, String hashedPassword, String mail, String name, String lastname){
@@ -43,9 +43,9 @@ public class User implements Cloneable{
        /**
         * Normal constructor for new users created in the UserController
         * 
-        * @param userName
-        * @param password
-        * @throws Exception
+        * @param userName                                      user name
+        * @param password                                      password
+        * @throws IllegalArgumentException     user name or password does not meet requirements
         */
        public User(String userName, String password) throws Exception{
                if(userName == null) throw new IllegalArgumentException("Username must not be null");
@@ -131,23 +131,39 @@ public class User implements Cloneable{
                return m.matches();
        }
        
+       /* (non-Javadoc)
+        * @see java.lang.Object#clone()
+        */
        @Override
     public User clone() throws CloneNotSupportedException {
         return (User)super.clone();
     }
        
+       /**
+        * @param permission
+        */
        public void addPermission(Permissions permission){
                permissions.add(permission);
        }
        
+       /**
+        * @param permission
+        */
        public void removePermission(Permissions permission){
                if(permissions.contains(permission)) permissions.remove(permission);
        }
        
+       /**
+        * @return
+        */
        public Set<Permissions> getPermissions(){
                return permissions;
        }
        
+       /**
+        * @param permission
+        * @return
+        */
        public boolean hasPermission(Permissions permission){
                return permissions.contains(permission);
        }