001: /*
002: * ====================================================================
003: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
004: *
005: * This software is licensed as described in the file COPYING, which
006: * you should have received as part of this distribution. The terms
007: * are also available at http://svnkit.com/license.html.
008: * If newer versions of this license are posted there, you may use a
009: * newer version instead, at your option.
010: * ====================================================================
011: */
012: package org.tmatesoft.svn.core.wc.admin;
013:
014: import org.tmatesoft.svn.core.SVNNodeKind;
015:
016: /**
017: * <b>SVNChangeEntry</b> objects are used to pass path change information to clients.
018: * These objects are passed to {@link ISVNChangeEntryHandler}.
019: *
020: * @version 1.1.1
021: * @author TMate Software Ltd.
022: * @since 1.1.1
023: */
024: public class SVNChangeEntry {
025: /**
026: * Char <span class="javastring">'A'</span> (item added).
027: */
028: public static final char TYPE_ADDED = 'A';
029:
030: /**
031: * Char <span class="javastring">'D'</span> (item deleted).
032: */
033: public static final char TYPE_DELETED = 'D';
034:
035: /**
036: * Char <span class="javastring">'U'</span> (item updated).
037: */
038: public static final char TYPE_UPDATED = 'U';
039:
040: private String myPath;
041: private char myType;
042: private String myCopyFromPath;
043: private long myCopyFromRevision;
044: private boolean myHasTextModifications;
045: private boolean myHasPropModifications;
046: private SVNNodeKind myKind;
047:
048: /**
049: * Constructs a change entry object.
050: *
051: * @param path the path of a changed item
052: * @param type a change type (one of static fields)
053: * @param copyFromPath a copy-from source path (if the item is copied)
054: * @param copyFromRevision a revision of a copy-from source (if the item is copied)
055: * @param hasTextModifications <span class="javakeyword">true</span> if <code>path</code>
056: * is a file and it's modified, <span class="javakeyword">false</span>
057: * otherwise
058: * @param hasPropModifications <span class="javakeyword">true</span> if the item has
059: * property modifications
060: */
061: public SVNChangeEntry(String path, SVNNodeKind kind, char type,
062: String copyFromPath, long copyFromRevision,
063: boolean hasTextModifications, boolean hasPropModifications) {
064: myPath = path;
065: myKind = kind;
066: myType = type;
067: myCopyFromPath = copyFromPath;
068: myCopyFromRevision = copyFromRevision;
069: myHasTextModifications = hasTextModifications;
070: myHasPropModifications = hasPropModifications;
071: }
072:
073: /**
074: * Returns a copy-from source path.
075: *
076: * @return a copy-from path
077: */
078: public String getCopyFromPath() {
079: return myCopyFromPath;
080: }
081:
082: /**
083: * Returns a copy-from source revision.
084: *
085: * @return a copy-from revision number
086: */
087: public long getCopyFromRevision() {
088: return myCopyFromRevision;
089: }
090:
091: /**
092: * Returns the absolute path of the changed item represented by
093: * this object.
094: *
095: * @return the absolute path
096: */
097: public String getPath() {
098: return myPath;
099: }
100:
101: /**
102: * Returns the type of the item change.
103: *
104: * @return a char that is one of static fields of this class
105: */
106: public char getType() {
107: return myType;
108: }
109:
110: /**
111: * Says whether the item's properties were
112: * modified.
113: *
114: * @return <span class="javakeyword">true</span> if
115: * the item has property modifications, otherwise
116: * <span class="javakeyword">false</span>
117: */
118: public boolean hasPropertyModifications() {
119: return myHasPropModifications;
120: }
121:
122: /**
123: * Says whether the file item's contents were
124: * modified. This method is relevant only for
125: * file contents.
126: *
127: * @return <span class="javakeyword">true</span> if
128: * the item has text modifications, otherwise
129: * <span class="javakeyword">false</span>
130: */
131: public boolean hasTextModifications() {
132: return myHasTextModifications;
133: }
134:
135: /**
136: * Returns the node kind of the item.
137: *
138: * @return an item node kind
139: */
140: public SVNNodeKind getKind() {
141: return myKind;
142: }
143: }
|