Below is the code for email class:
public class Email implements Serializable {
/** identifier field */
private long emailId;
/** identifier field */
private Object emailattachment;
/** full constructor */
public Email(long emailId Object emailattachment) {
this.emailId = emailId;
this.emailattachment = emailattachment;
}
/** default constructor */
public Email() {
}
public long getEmailId() {
return this.emailId;
}
public void setEmailId(long emailId) {
this.emailId = emailId;
}
public Object getEmailattachment() {
return this.emailattachment;
}
public void setEmailattachment(Object emailattachment) {
this.emailattachment = emailattachment;
}
public String toString() {
return new ToStringBuilder(this)
.append("emailId", getEmailId())
.append("emailattachment", getEmailattachment())
.toString();
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( !(other instanceof Email) ) return false;
Email castOther = (Email) other;
return new EqualsBuilder()
.append(this.getEmailId(), castOther.getEmailId())
.append(this.getEmailattachment(), castOther.getEmailattachment())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getEmailId())
.append(getEmailattachment())
.toHashCode();
}
}
|