001: package ru.emdev.EmForge.svn.web;
002:
003: /**
004: * Value object to represent each log entry
005: */
006: public class RevisionLogItem implements java.io.Serializable,
007: java.lang.Comparable<RevisionLogItem> {
008: /**
009: * The serial version UID of this class. Needed for serialization.
010: */
011: private static final long serialVersionUID = 1821997104631519646L;
012:
013: public RevisionLogItem() {
014: }
015:
016: public RevisionLogItem(java.lang.String revision,
017: java.lang.String changeSet, java.util.Date date,
018: java.lang.String author, java.lang.String logMessage,
019: char changeKind) {
020: this .revision = revision;
021: this .changeSet = changeSet;
022: this .date = date;
023: this .author = author;
024: this .logMessage = logMessage;
025: this .changeKind = changeKind;
026: }
027:
028: /**
029: * Copies constructor from other RevisionLogItem
030: *
031: * @param otherBean, cannot be <code>null</code>
032: * @throws java.lang.NullPointerException if the argument is <code>null</code>
033: */
034: public RevisionLogItem(RevisionLogItem otherBean) {
035: this (otherBean.getRevision(), otherBean.getChangeSet(),
036: otherBean.getDate(), otherBean.getAuthor(), otherBean
037: .getLogMessage(), otherBean.getChangeKind());
038: }
039:
040: /**
041: * Copies all properties from the argument value object into this value object.
042: */
043: public void copy(RevisionLogItem otherBean) {
044: if (otherBean != null) {
045: this .setRevision(otherBean.getRevision());
046: this .setChangeSet(otherBean.getChangeSet());
047: this .setDate(otherBean.getDate());
048: this .setAuthor(otherBean.getAuthor());
049: this .setLogMessage(otherBean.getLogMessage());
050: this .setChangeKind(otherBean.getChangeKind());
051: }
052: }
053:
054: private java.lang.String revision;
055:
056: /**
057: * The revision this entry belongs to
058: */
059: public java.lang.String getRevision() {
060: return this .revision;
061: }
062:
063: public void setRevision(java.lang.String revision) {
064: this .revision = revision;
065: }
066:
067: private java.lang.String changeSet;
068:
069: /**
070: * The change set refereced by this entry
071: */
072: public java.lang.String getChangeSet() {
073: return this .changeSet;
074: }
075:
076: public void setChangeSet(java.lang.String changeSet) {
077: this .changeSet = changeSet;
078: }
079:
080: private java.util.Date date;
081:
082: /**
083: * Log entry date
084: */
085: public java.util.Date getDate() {
086: return this .date;
087: }
088:
089: public void setDate(java.util.Date date) {
090: this .date = date;
091: }
092:
093: private java.lang.String author;
094:
095: /**
096: * Log entry author
097: */
098: public java.lang.String getAuthor() {
099: return this .author;
100: }
101:
102: public void setAuthor(java.lang.String author) {
103: this .author = author;
104: }
105:
106: private java.lang.String logMessage;
107:
108: /**
109: * Log entry commit message
110: */
111: public java.lang.String getLogMessage() {
112: return this .logMessage;
113: }
114:
115: public void setLogMessage(java.lang.String logMessage) {
116: this .logMessage = logMessage;
117: }
118:
119: private char changeKind;
120:
121: /**
122: * Log entry change kind (M=Modified, A=Added, C=Copied)
123: */
124: public char getChangeKind() {
125: return this .changeKind;
126: }
127:
128: public void setChangeKind(char changeKind) {
129: this .changeKind = changeKind;
130: }
131:
132: public int compareTo(RevisionLogItem other) {
133: return Long.valueOf(revision) > Long.valueOf(other.revision) ? -1
134: : 1;
135: }
136:
137: }
|