Files
Test2Jakarta/src/main/java/com/test/beans/User.java
2025-09-22 17:52:24 +02:00

49 lines
1.2 KiB
Java

/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.test.beans;
/**
*
* @author steve.maingana
*/
public class User {
private String pseudo;
private String motDePasse;
public User(String pseudo, String motDePasse) {
this.pseudo = pseudo;
this.motDePasse = motDePasse;
}
public String getPseudo() {
return this.pseudo;
}
private String getMDP() {
return this.motDePasse;
}
public void setPseudo(String pseudo) {
this.pseudo = pseudo;
}
public void setMDP(String MDP) {
this.motDePasse = MDP;
}
@Override
public boolean equals(Object user) {
boolean resultat = false;
if (user.getClass().equals(this.getClass())) {
User toCompare = (User) user;
if (this.getPseudo().equals(toCompare.getPseudo()) && this.getMDP().equals(toCompare.getMDP())) {
resultat = true;
}
}
return resultat;
};
}