Files
ASDL/asdl/src/totale/p240116/Docente.java
T
Emanuele Slusarz 66f053aba3 arch
2026-05-23 20:37:48 +02:00

58 lines
932 B
Java

package totale.p240116;
public class Docente implements Comparable<Docente>{
// Variables
private String ORCID;
private String nome;
private String cognome;
private int eta;
// Constructor
public Docente(
String ORCID,
String nome,
String cognome,
int eta) {
this.ORCID = ORCID;
this.nome = nome;
this.cognome = cognome;
this.eta = eta;
}
// Getter
public String ORCID() {
return ORCID;
}
public String nome() {
return nome;
}
public String cognome() {
return cognome;
}
public int eta() {
return eta;
}
// Equals
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj == this) return true;
if (!(obj instanceof Docente)) return false;
Docente docente = (Docente) obj;
return this.ORCID.equals(docente.ORCID);
}
// Comparable
@Override
public int compareTo(Docente docente) {
return this.ORCID.compareTo(docente.ORCID);
}
}