jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r793012 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
Date Fri, 10 Jul 2009 16:22:14 GMT
Author: jukka
Date: Fri Jul 10 16:22:14 2009
New Revision: 793012

URL: http://svn.apache.org/viewvc?rev=793012&view=rev
Log:
#0000 - JCR-1232: Merge UUID to NodeId

Add extra methods to NodeId to make it easier to later get rid of the underlying UUID instance.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java?rev=793012&r1=793011&r2=793012&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
Fri Jul 10 16:22:14 2009
@@ -56,6 +56,14 @@
         this(new UUID(uuid));
     }
 
+    public NodeId(byte[] bytes) {
+        this(new UUID(bytes));
+    }
+
+    public NodeId(long msb, long lsb) {
+        this(new UUID(msb, lsb));
+    }
+
     /**
      * Returns <code>true</code> as this class represents a node identifier,
      * not a property identifier.
@@ -104,6 +112,24 @@
         return uuid.getRawBytes();
     }
 
+    /**
+     * Returns the most significant bits of the UUID.
+     *
+     * @return most significant 64 bits
+     */
+    public long getMostSignificantBits() {
+        return uuid.getMostSignificantBits();
+    }
+
+    /**
+     * Returns the least significant bits of the UUID.
+     *
+     * @return least significant 64 bits
+     */
+    public long getLeastSignificantBits() {
+        return uuid.getLeastSignificantBits();
+    }
+
     //----------------------------------------------------------< Comparable >
 
     /**



Mime
View raw message