commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1036311 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs: VcsCommitListener.java VcsModifyListener.java VcsStatus.java VcsUpdateListener.java
Date Thu, 18 Nov 2010 01:41:15 GMT
Author: rgoers
Date: Thu Nov 18 01:41:15 2010
New Revision: 1036311

URL: http://svn.apache.org/viewvc?rev=1036311&view=rev
Log:
Convert VcsStatus to an enum.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsCommitListener.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsModifyListener.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsStatus.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsUpdateListener.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsCommitListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsCommitListener.java?rev=1036311&r1=1036310&r2=1036311&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsCommitListener.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsCommitListener.java
Thu Nov 18 01:41:15 2010
@@ -26,8 +26,7 @@ public interface VcsCommitListener
     /**
      *
      * @param path The path.
-     * @param contentStatus takes one of the values as defined in the
-     * @see VcsStatus constants.
+     * @param contentStatus The status;
      */
-    void commited(final String path, final int contentStatus);
+    void commited(final String path, final VcsStatus contentStatus);
 }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsModifyListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsModifyListener.java?rev=1036311&r1=1036310&r2=1036311&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsModifyListener.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsModifyListener.java
Thu Nov 18 01:41:15 2010
@@ -28,5 +28,5 @@ public interface VcsModifyListener
      * @param path The path String.
      * @param contentStatus The content status.
      */
-    void modified(final String path, final int contentStatus);
+    void modified(final String path, final VcsStatus contentStatus);
 }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsStatus.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsStatus.java?rev=1036311&r1=1036310&r2=1036311&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsStatus.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsStatus.java
Thu Nov 18 01:41:15 2010
@@ -16,40 +16,48 @@
  */
 package org.apache.commons.vfs2.operations.vcs;
 
-import org.apache.commons.vfs2.operations.FileOperation;
-
 /**
  *
  * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
  * @since 0.1
  */
-public interface VcsStatus extends FileOperation
+public enum VcsStatus
 {
-    int UNKNOWN = -1;
-    int NOT_MODIFIED = 0;
-    int ADDED = 1;
-    int CONFLICTED = 2;
-    int DELETED = 3;
-    int MERGED = 4;
-    int IGNORED = 5;
-    int MODIFIED = 6;
-    int REPLACED = 7;
-    int UNVERSIONED = 8;
-    int MISSING = 9;
-    int OBSTRUCTED = 10;
-    int REVERTED = 11;
-    int RESOLVED = 12;
-    int COPIED = 13;
-    int MOVED = 14;
-    int RESTORED = 15;
-    int UPDATED = 16;
-    int EXTERNAL = 18;
-    int CORRUPTED = 19;
-    int NOT_REVERTED = 20;
+    UNKNOWN(-1),
+    NOT_MODIFIED(0),
+    ADDED(1),
+    CONFLICTED(2),
+    DELETED(3),
+    MERGED(4),
+    IGNORED(5),
+    MODIFIED(6),
+    REPLACED(7),
+    UNVERSIONED(8),
+    MISSING(9),
+    OBSTRUCTED(10),
+    REVERTED(11),
+    RESOLVED(12),
+    COPIED(13),
+    MOVED(14),
+    RESTORED(15),
+    UPDATED(16),
+    EXTERNAL(18),
+    CORRUPTED(19),
+    NOT_REVERTED(20);
+
+    private int status;
 
     /**
      *
      * @return the status of FileObject
      */
-    int getStatus();
+    public int getStatus()
+    {
+        return status;
+    }
+
+    private VcsStatus(int status)
+    {
+        this.status = status;
+    }
 }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsUpdateListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsUpdateListener.java?rev=1036311&r1=1036310&r2=1036311&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsUpdateListener.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/operations/vcs/VcsUpdateListener.java
Thu Nov 18 01:41:15 2010
@@ -27,9 +27,7 @@ public interface VcsUpdateListener
      *
      * @param path The path.
      * @param revision The revision number.
-     * @param contentStatus
-     *            takes one of the values as defined in the
-     * @see VcsStatus constants.
+     * @param contentStatus The status.
      */
-    void updated(final String path, final long revision, final int contentStatus);
+    void updated(final String path, final long revision, final VcsStatus contentStatus);
 }



Mime
View raw message