jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1149611 - /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
Date Fri, 22 Jul 2011 14:13:37 GMT
Author: mduerig
Date: Fri Jul 22 14:13:36 2011
New Revision: 1149611

URL: http://svn.apache.org/viewvc?rev=1149611&view=rev
Log:
spi2microkernel (WIP)
- implement equals, hashCode, toString for binaries

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java?rev=1149611&r1=1149610&r2=1149611&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
Fri Jul 22 14:13:36 2011
@@ -187,4 +187,35 @@ public class QBinaryValue implements QVa
     }
 
     public void discard() {}
+
+    public String toString() {
+        try {
+            return getString();
+        }
+        catch (RepositoryException e) {
+            return e.getMessage(); 
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof QBinaryValue) {
+            QBinaryValue other = (QBinaryValue) obj;
+            return blobId == null
+                ? other.blobId == null
+                : blobId.equals(other.blobId);
+        }
+
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return 0;
+    }
+
+
 }



Mime
View raw message