incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1465391 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
Date Sun, 07 Apr 2013 13:17:43 GMT
Author: cziegeler
Date: Sun Apr  7 13:17:43 2013
New Revision: 1465391

URL: http://svn.apache.org/r1465391
Log:
Implement toString method

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1465391&r1=1465390&r2=1465391&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
Sun Apr  7 13:17:43 2013
@@ -28,6 +28,7 @@ import java.util.Calendar;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -597,6 +598,30 @@ public class JcrPropertyMap
 		return transformedEntries;
 	}
 
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("JcrPropertyMap [node=");
+        sb.append(this.node);
+        sb.append(", values={");
+        final Iterator<Map.Entry<String, Object>> iter = this.entrySet().iterator();
+        boolean first = true;
+        while ( iter.hasNext() ) {
+            if ( first ) {
+                first = false;
+            } else {
+                sb.append(", ");
+            }
+            final Map.Entry<String, Object> e = iter.next();
+            sb.append(e.getKey());
+            sb.append("=");
+            sb.append(e.getValue());
+        }
+        sb.append("}]");
+        return sb.toString();
+    }
+
+
     /**
      * This is an extended version of the object input stream which uses the
      * thread context class loader.



Mime
View raw message