001: package org.contineo.core.document;
002:
003: import java.util.Date;
004:
005: import org.contineo.core.i18n.DateBean;
006:
007: /**
008: * @author Michael Scholz
009: * @author Alessandro Gasparini
010: */
011: public class History {
012: public final static String STORED = "msg.jsp.docstored";
013:
014: public final static String CHANGED = "msg.jsp.docchanged";
015:
016: public final static String CHECKIN = "msg.jsp.doccheckedin";
017:
018: public final static String CHECKOUT = "msg.jsp.doccheckedout";
019:
020: private int historyId;
021:
022: private int docId;
023:
024: private String date = "";
025:
026: private String username = "";
027:
028: private String event = "";
029:
030: public History() {
031: }
032:
033: /**
034: * @return Returns the historyId.
035: */
036: public int getHistoryId() {
037: return historyId;
038: }
039:
040: /**
041: * @param historyId The historyId to set.
042: */
043: public void setHistoryId(int historyId) {
044: this .historyId = historyId;
045: }
046:
047: /**
048: * @return Returns the date.
049: */
050: public String getDate() {
051: return date;
052: }
053:
054: public Date getDecodedDate() {
055: return DateBean.dateFromCompactString(date);
056: }
057:
058: /**
059: * @param date The date to set.
060: */
061: public void setDate(String date) {
062: this .date = date;
063: }
064:
065: /**
066: * @return Returns the docId.
067: */
068: public int getDocId() {
069: return docId;
070: }
071:
072: /**
073: * @param docId The docId to set.
074: */
075: public void setDocId(int docId) {
076: this .docId = docId;
077: }
078:
079: /**
080: * @return Returns the event.
081: */
082: public String getEvent() {
083: return event;
084: }
085:
086: /**
087: * @param event The event to set.
088: */
089: public void setEvent(String event) {
090: this .event = event;
091: }
092:
093: /**
094: * @return Returns the username.
095: */
096: public String getUsername() {
097: return username;
098: }
099:
100: /**
101: * @param username The username to set.
102: */
103: public void setUsername(String username) {
104: this .username = username;
105: }
106:
107: @Override
108: public boolean equals(Object arg0) {
109: if (!(arg0 instanceof History))
110: return false;
111: History other = (History) arg0;
112: return other.getHistoryId() == this .getHistoryId();
113: }
114:
115: @Override
116: public int hashCode() {
117: return new Integer(historyId).hashCode();
118: }
119: }
|