Skip to content
Snippets Groups Projects
User.java 1.25 KiB
package dto;

public class User {
    private int userID;
    private String username;
    private String pwd;


    //      Constructor     //

    public User(int id, String username, String pwd){
        this.userID = id;
        this.username = username;
        this.pwd = pwd;
    }

    // Seulement utile pour la vérification à l'authentification
    public User(String username, String pwd){
        this.username = username;
        this.pwd = pwd;
    }

    public User(){
        this.username = null;
        this.pwd = null;
    }


    //      Getter      //

    public int getId(){
        return this.userID;
    }

    public String getUserName(){
        return this.username;
    }

    public String getPwd(){ // Probablement inutile ???
        return this.pwd;
    }



    //      Setter      //

    public void setID(int nId){
        this.userID = nId;
    }

    public void setUsername(String nUsername){
        this.username = nUsername;
    }

    public void setPassword(String nPwd){
        this.pwd = nPwd;
    }

    @Override
    public String toString() {
        return "User{" +
                "userID=" + userID +
                ", username='" + username + '\'' +
                ", pwd='" + pwd + '\'' +
                '}';
    }
}