00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 package com.scalagent.joram.mom.dest.mail;
00024
00025 public class SenderInfo implements java.io.Serializable {
00029 private static final long serialVersionUID = 1L;
00030 public String smtpServer;
00031 public String to;
00032 public String cc;
00033 public String bcc;
00034 public String from;
00035 public String subject;
00036 public String selector;
00037
00038 public SenderInfo(String smtpServer,
00039 String to,
00040 String cc,
00041 String bcc,
00042 String from,
00043 String subject,
00044 String selector) {
00045 this.smtpServer = smtpServer;
00046 this.to = to;
00047 this.cc = cc;
00048 this.bcc = bcc;
00049 this.from = from;
00050 this.subject = subject;
00051 this.selector = selector;
00052 }
00053
00054 public String toString() {
00055 StringBuffer sb = new StringBuffer();
00056 sb.append("(smtp=");
00057 sb.append(smtpServer);
00058 sb.append(",to=");
00059 sb.append(to);
00060 sb.append(",cc=");
00061 sb.append(cc);
00062 sb.append(",bcc=");
00063 sb.append(bcc);
00064 sb.append(",from=");
00065 sb.append(from);
00066 sb.append(",subject=");
00067 sb.append(subject);
00068 sb.append(",selector=");
00069 sb.append(selector);
00070 sb.append(")");
00071 return sb.toString();
00072 }
00073
00074 public boolean equals(Object obj) {
00075 if (! (obj instanceof SenderInfo))
00076 return false;
00077 else {
00078 SenderInfo si = (SenderInfo) obj;
00079 boolean b = true;
00080 if ((smtpServer != null) && (si.smtpServer != null))
00081 b &= smtpServer.equals(si.smtpServer);
00082 if ((to != null) && (si.to != null))
00083 b &= to.equals(si.to);
00084 if ((cc != null) && (si.cc != null))
00085 b &= cc.equals(si.cc);
00086 if ((bcc != null) && (si.bcc != null))
00087 b &= bcc.equals(si.bcc);
00088 if ((from != null) && (si.from != null))
00089 b &= from.equals(si.from);
00090 if ((subject != null) && (si.subject != null))
00091 b &= subject.equals(si.subject);
00092 if ((selector != null) && (si.selector != null))
00093 b &= selector.equals(si.selector);
00094 return b;
00095 }
00096 }
00097 }