1 16 package com.blandware.atleap.model.core; 17 18 import com.blandware.atleap.common.Constants; 19 20 import java.util.ArrayList ; 21 import java.util.HashMap ; 22 import java.util.List ; 23 import java.util.Map ; 24 25 46 public class MailTemplate extends Localizable { 47 48 50 53 protected String identifier; 54 57 protected String mimeType = Constants.MIME_TYPE_PLAIN; 58 59 62 protected List availableVariables = new ArrayList (); 63 64 67 protected Map from = new HashMap (); 68 69 72 protected Map subject = new HashMap (); 73 74 77 protected Map body = new HashMap (); 78 79 82 protected Map charset = new HashMap (); 83 84 86 89 public MailTemplate() { 90 } 91 92 94 100 public String getIdentifier() { 101 return identifier; 102 } 103 104 109 public void setIdentifier(String identifier) { 110 this.identifier = identifier; 111 } 112 113 120 public String getMimeType() { 121 return mimeType; 122 } 123 124 129 public void setMimeType(String mimeType) { 130 this.mimeType = mimeType; 131 } 132 133 138 public boolean isPlain() { 139 return this.mimeType.equalsIgnoreCase(Constants.MIME_TYPE_PLAIN); 140 } 141 142 144 152 public Map getFrom() { 153 return from; 154 } 155 156 162 public void setFrom(Map from) { 163 this.from = from; 164 } 165 166 174 public Map getSubject() { 175 return subject; 176 } 177 178 184 public void setSubject(Map subject) { 185 this.subject = subject; 186 } 187 188 196 public Map getBody() { 197 return body; 198 } 199 200 206 public void setBody(Map body) { 207 this.body = body; 208 } 209 210 218 public Map getCharset() { 219 return charset; 220 } 221 222 228 public void setCharset(Map charset) { 229 this.charset = charset; 230 } 231 232 237 public List getAvailableVariables() { 238 return availableVariables; 239 } 240 241 246 public void setAvailableVariables(List availableVariables) { 247 this.availableVariables = availableVariables; 248 } 249 250 public boolean equals(Object o) { 251 if ( this == o ) { 252 return true; 253 } 254 if ( !(o instanceof MailTemplate) ) { 255 return false; 256 } 257 258 final MailTemplate mailTemplate = (MailTemplate) o; 259 260 if ( identifier != null ? !identifier.equals(mailTemplate.identifier) : mailTemplate.identifier != null ) { 261 return false; 262 } 263 264 return true; 265 } 266 267 public int hashCode() { 268 return (identifier != null ? identifier.hashCode() : 0); 269 } 270 271 } 272 273 | Popular Tags |