/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sudoku.data.model;

import java.util.List;

public class User implements Ruleable {

    private int id;
    private String pseudo;
    private String salt;
    private String birthdate;
    private String profilePicturePath;
    private String createDate;
    private String updateDate;
    private String ipAdress;
    private List<ContactCategory> contactCategories;
    
    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the pseudo
     */
    public String getPseudo() {
        return pseudo;
    }

    /**
     * @param pseudo the pseudo to set
     */
    public void setPseudo(String pseudo) {
        this.pseudo = pseudo;
    }

    /**
     * @return the salt
     */
    public String getSalt() {
        return salt;
    }

    /**
     * @param salt the salt to set
     */
    public void setSalt(String salt) {
        this.salt = salt;
    }

    /**
     * @return the birthdate
     */
    public String getBirthdate() {
        return birthdate;
    }

    /**
     * @param birthdate the birthdate to set
     */
    public void setBirthdate(String birthdate) {
        this.birthdate = birthdate;
    }

    /**
     * @return the profilePicturePath
     */
    public String getProfilePicturePath() {
        return profilePicturePath;
    }

    /**
     * @param profilePicturePath the profilePicturePath to set
     */
    public void setProfilePicturePath(String profilePicturePath) {
        this.profilePicturePath = profilePicturePath;
    }

    /**
     * @return the createDate
     */
    public String getCreateDate() {
        return createDate;
    }

    /**
     * @param createDate the createDate to set
     */
    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    /**
     * @return the updateDate
     */
    public String getUpdateDate() {
        return updateDate;
    }

    /**
     * @param updateDate the updateDate to set
     */
    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    /**
     * @return the ipAdress
     */
    public String getIpAdress() {
        return ipAdress;
    }

    /**
     * @param ipAdress the ipAdress to set
     */
    public void setIpAdress(String ipAdress) {
        this.ipAdress = ipAdress;
    }

    /**
     * @return the contactCategories
     */
    public List<ContactCategory> getContactCategories() {
        return contactCategories;
    }

    /**
     * @param contactCategories the contactCategories to set
     */
    public void setContactCategories(List<ContactCategory> contactCategories) {
        this.contactCategories = contactCategories;
    }

    @Override
    public Boolean hasUser(User user) {
        return this.equals(user);
    }
    
    @Override
    public Boolean isUser(){
        return true;
    }
}

@@ -232,16 +232,102 @@
 il.List;
+%0Aimport java.util.Date;%0Aimport java.util.Calendar;%0Aimport java.util.GregorianCalendar;
 %0A%0Apublic
@@ -365,28 +365,8 @@
  %7B%0A%0A
-    private int id;%0A
     
@@ -428,24 +428,51 @@
 vate String 
+password;%0A    private Date 
 birthdate;%0A 
@@ -521,22 +521,20 @@
 private 
-String
+Date
  createD
@@ -550,22 +550,20 @@
 private 
-String
+Date
  updateD
@@ -662,438 +662,228 @@
     
-/**%0A     * @return the id%0A     */%0A    public int getId() %7B%0A        return id;%0A    %7D%0A%0A    /**%0A     * @param id the id to set%0A     */%0A    public void setId(int id) %7B%0A        this.id = id;%0A    %7D%0A%0A    /**%0A     * @return the pseudo%0A     */%0A    public String getPseudo() %7B%0A        return pseudo;%0A    %7D%0A%0A    /**%0A     * @param pseudo the pseudo to set%0A     */%0A    public void setPseudo(String pseudo) %7B%0A        this.pseudo = pseudo;%0A    %7D
+public User(String pseudo, String brutPassword, Date birthdate, String profilePicturePath)%7B%0A        %0A        %0A    %7D%0A%0A    /**%0A     * @return the pseudo%0A     */%0A    public String getPseudo() %7B%0A        return pseudo;%0A    %7D%0A
 %0A%0A  
@@ -969,33 +969,32 @@
 urn salt;%0A    %7D%0A
-%0A
     /**%0A     * @
@@ -997,106 +997,105 @@
  * @
-param salt the salt to set%0A     */%0A    public void setSalt(String salt) %7B%0A        this.salt = salt
+return the hash of the password%0A     */%0A    public String getPassword() %7B%0A        return password
 ;%0A  
@@ -1144,37 +1144,28 @@
      */%0A    
-public String
+Date
  getBirthdat
@@ -1293,22 +1293,20 @@
 rthdate(
-String
+Date
  birthda
@@ -1339,32 +1339,59 @@
 te = birthdate;%0A
+        this.UpdateDate();%0A
     %7D%0A%0A    /**%0A 
@@ -1713,32 +1713,59 @@
 ilePicturePath;%0A
+        this.UpdateDate();%0A
     %7D%0A%0A    /**%0A 
@@ -1808,30 +1808,28 @@
 %0A    public 
-String
+Date
  getCreateDa
@@ -1873,167 +1873,8 @@
  %7D%0A%0A
-    /**%0A     * @param createDate the createDate to set%0A     */%0A    public void setCreateDate(String createDate) %7B%0A        this.createDate = createDate;%0A    %7D%0A%0A
     
@@ -1922,30 +1922,28 @@
 %0A    public 
-String
+Date
  getUpdateDa
@@ -2002,31 +2002,20 @@
   * 
-@param updateDate the u
+Update The U
 pdat
@@ -2019,23 +2019,16 @@
 dateDate
- to set
 %0A     */
@@ -2033,30 +2033,28 @@
 */%0A    p
-ublic
+rivate
  void 
-set
 UpdateDa
@@ -2060,28 +2060,59 @@
 ate(
-String updateDate) %7B
+) %7B%0A        Calendar cal = new GregorianCalendar();
 %0A   
@@ -2134,26 +2134,30 @@
 eDate = 
-updateDate
+cal.getTime ()
 ;%0A    %7D%0A
@@ -2399,32 +2399,59 @@
 ess = ipAdress;%0A
+        this.UpdateDate();%0A
     %7D%0A%0A    /**%0A 
@@ -2794,32 +2794,59 @@
 tactCategories;%0A
+        this.UpdateDate();%0A
     %7D%0A%0A    @Over
@@ -3005,10 +3005,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

Update User.java