/******************************************************************************* * Copyright (c) 2004, 2007 Boeing. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Boeing - initial API and implementation *******************************************************************************/ package org.eclipse.osee.mail; import java.util.Collection; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** * @author Roberto E. Escobar */ @XmlRootElement public class SendMailStatus { private final Set entries = new HashSet(); public void add(MailStatus newStatus) { entries.add(newStatus); } @XmlElement public Collection getEntries() { return entries; } @XmlRootElement public static class MailStatus { private String uuid; private String subject; private Date dateSent; private boolean verified; private final Set fromAddress = new HashSet(); private final Set invalidAddress = new HashSet(); private final Set sentAddress = new HashSet(); private final Set unsentAddress = new HashSet(); public void setUuid(String uuid) { this.uuid = uuid; } public void setDateSent(Date dateSent) { this.dateSent = dateSent; } public void setSubject(String subject) { this.subject = subject; } public String getUuid() { return uuid; } public Date getDateSent() { return dateSent; } public String getSubject() { return subject; } public boolean isVerified() { return verified; } public void setVerified(boolean verified) { this.verified = verified; } @XmlElement public Set getFromAddress() { return fromAddress; } @XmlElement public Set getInvalidAddress() { return invalidAddress; } @XmlElement public Set getSentAddress() { return sentAddress; } @XmlElement public Set getUnsentAddress() { return unsentAddress; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((uuid == null) ? 0 : uuid.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MailStatus other = (MailStatus) obj; if (uuid == null) { if (other.uuid != null) { return false; } } else if (!uuid.equals(other.uuid)) { return false; } return true; } } }