View Javadoc
1 package org.hedwig.core; 2 3 import java.util.Date; 4 import java.util.List; 5 import java.util.Map; 6 7 /*** 8 * @author Keith Gaddis 9 * 10 * 11 */ 12 public class Envelope{ 13 14 private long _envelopeId; 15 private Map _headers; 16 private List _parts; 17 private Date _dateReceived; 18 private boolean _unread; 19 20 21 public Envelope(){ 22 super(); 23 } 24 25 /*** 26 * Returns the headers. 27 * @return Map 28 */ 29 public Map getAttributes() { 30 return _headers; 31 } 32 33 /*** 34 * Returns the parts. 35 * @return List 36 */ 37 public List getParts() { 38 return _parts; 39 } 40 41 public String getAttribute(String name){ 42 return (String) _headers.get(name); 43 } 44 45 public void addHeader(String name, String value){ 46 _headers.put(name, value); 47 } 48 49 /*** 50 * Sets the headers. 51 * @param headers The headers to set 52 */ 53 private void setHeaders(Map headers) { 54 _headers= headers; 55 } 56 57 /*** 58 * Sets the parts. 59 * @param parts The parts to set 60 */ 61 private void setParts(List parts) { 62 _parts= parts; 63 } 64 65 /*** 66 * Returns the dateReceived. 67 * @return Date 68 */ 69 public Date getDateReceived() { 70 return _dateReceived; 71 } 72 73 /*** 74 * Returns the unread. 75 * @return boolean 76 */ 77 public boolean isViewed() { 78 return _unread; 79 } 80 81 /*** 82 * Sets the dateReceived. 83 * @param dateReceived The dateReceived to set 84 */ 85 public void setDateReceived(Date dateReceived) { 86 _dateReceived= dateReceived; 87 } 88 89 /*** 90 * Sets the unread. 91 * @param unread The unread to set 92 */ 93 public void setViewed(boolean unread) { 94 _unread= unread; 95 } 96 97 public Attribute getFrom(){ 98 return (Attribute)_headers.get("From"); 99 } 100 101 public void setFrom(Attribute hdr){ 102 _headers.put("From", hdr); 103 } 104 105 public Attribute getDate(){ 106 return (Attribute)_headers.get("Date"); 107 } 108 public void setDate(Attribute date){ 109 _headers.put("Date", date); 110 } 111 112 private long getEnvelopeId(){ 113 return _envelopeId; 114 } 115 private void setEnvelopeId(long envelopeId){ 116 _envelopeId=envelopeId; 117 } 118 }

This page was automatically generated by Maven