1 23 package com.scalagent.joram.mom.dest.mail; 24 25 public class SenderInfo implements java.io.Serializable { 26 public String smtpServer; 27 public String to; 28 public String cc; 29 public String bcc; 30 public String from; 31 public String subject; 32 public String selector; 33 34 public SenderInfo(String smtpServer, 35 String to, 36 String cc, 37 String bcc, 38 String from, 39 String subject, 40 String selector) { 41 this.smtpServer = smtpServer; 42 this.to = to; 43 this.cc = cc; 44 this.bcc = bcc; 45 this.from = from; 46 this.subject = subject; 47 this.selector = selector; 48 } 49 50 public String toString() { 51 StringBuffer sb = new StringBuffer (); 52 sb.append("(smtp="); 53 sb.append(smtpServer); 54 sb.append(",to="); 55 sb.append(to); 56 sb.append(",cc="); 57 sb.append(cc); 58 sb.append(",bcc="); 59 sb.append(bcc); 60 sb.append(",from="); 61 sb.append(from); 62 sb.append(",subject="); 63 sb.append(subject); 64 sb.append(",selector="); 65 sb.append(selector); 66 sb.append(")"); 67 return sb.toString(); 68 } 69 70 public boolean equals(Object obj) { 71 if (! (obj instanceof SenderInfo)) 72 return false; 73 else { 74 SenderInfo si = (SenderInfo) obj; 75 boolean b = true; 76 if ((smtpServer != null) && (si.smtpServer != null)) 77 b &= smtpServer.equals(si.smtpServer); 78 if ((to != null) && (si.to != null)) 79 b &= to.equals(si.to); 80 if ((cc != null) && (si.cc != null)) 81 b &= cc.equals(si.cc); 82 if ((bcc != null) && (si.bcc != null)) 83 b &= bcc.equals(si.bcc); 84 if ((from != null) && (si.from != null)) 85 b &= from.equals(si.from); 86 if ((subject != null) && (si.subject != null)) 87 b &= subject.equals(si.subject); 88 if ((selector != null) && (si.selector != null)) 89 b &= selector.equals(si.selector); 90 return b; 91 } 92 } 93 } 94 | Popular Tags |