package es.uv.garcosda.data.domain;

import java.io.Serializable;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

@Entity
@Table(name = "mails")
public class Mail implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	private String id;
	@Column(name="_from")
	private String from;
	@Column(name="_to")
	private String to;
	private String subject;
	private String body;
	
	public Mail() {}
	
	public Mail(String from, String to, String subject, String body) {
		this.from = from;
		this.to = to;
		this.subject = subject;
		this.body = body;
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}
	
	@Override
	public String toString() {
		return String.format("Email{from=%s, to=%s, subject=%s}", this.getFrom(), this.getTo(), this.getSubject());
	}
	
}
