El código de la clase Job está bien estructurado y cumple el principio ISP al mantener una única responsabilidad: representar la entidad sin depender de lógica de persistencia ni de presentación.
public class Job implements Serializable, Cloneable {
private static final long serialVersionUID = 9178806163995887915L;
private int id;
private int employerId;
private int priceId;
private String title;
private String description;
private Timestamp date;
public Job(int id, int employerId, int priceId, String title, String description, Timestamp date) {
this.id = id;
this.employerId = employerId;
this.priceId = priceId;
this.title = title;
this.description = description;
this.date = date;
}
// Getters y setters
public int getId() { return id; }
public int getEmployerId() { return employerId; }
public int getPriceId() { return priceId; }
public String getTitle() { return title; }
public String getDescription() { return description; }
public Timestamp getDate() { return date; }
@Override
public String toString() { return title; }
@Override
public int hashCode() { return Objects.hash(id, employerId, priceId, title); }
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Job other = (Job) obj;
return id == other.id && employerId == other.employerId && priceId == other.priceId;
}
El código de la clase Job está bien estructurado y cumple el principio ISP al mantener una única responsabilidad: representar la entidad sin depender de lógica de persistencia ni de presentación.
`