From ebed25719c19ef34c71ead92450eec9aca4c1feb Mon Sep 17 00:00:00 2001
From: ribeaudc <ribeaudc>
Date: Tue, 29 Jul 2008 11:29:42 +0000
Subject: [PATCH] change: - Add a 'toString' method.

SVN: 7570
---
 .../systemsx/cisd/common/collections/TableMap.java   | 12 ++++++++++++
 .../common/collections/TableMapNonUniqueKey.java     | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java b/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java
index 24f4b6eaf37..fc0f06d1ccf 100644
--- a/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java
+++ b/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java
@@ -23,6 +23,8 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.lang.builder.ToStringBuilder;
+
 /**
  * A table of rows of type <code>E</code> with random access via a key of type <code>K</code>.
  * 
@@ -188,6 +190,16 @@ public class TableMap<K, E> implements Iterable<E>
         return Collections.unmodifiableSet(map.keySet());
     }
 
+    //
+    // Object
+    //
+
+    @Override
+    public final String toString()
+    {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
     /**
      * Creates an iterator of the rows in the order they have been added. Removing is not supported.
      */
diff --git a/common/source/java/ch/systemsx/cisd/common/collections/TableMapNonUniqueKey.java b/common/source/java/ch/systemsx/cisd/common/collections/TableMapNonUniqueKey.java
index eb7e76fac64..bf657c1b6aa 100644
--- a/common/source/java/ch/systemsx/cisd/common/collections/TableMapNonUniqueKey.java
+++ b/common/source/java/ch/systemsx/cisd/common/collections/TableMapNonUniqueKey.java
@@ -23,6 +23,8 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
+import org.apache.commons.lang.builder.ToStringBuilder;
+
 /**
  * A table of rows of type <code>E</code> with random access via a key of type <code>K</code>
  * where the key does not have to be unique.
@@ -146,6 +148,16 @@ public class TableMapNonUniqueKey<K, E> implements Iterable<E>
         return map.get(key);
     }
 
+    //
+    // Object
+    //
+
+    @Override
+    public final String toString()
+    {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
     /**
      * Creates an iterator of the rows. Removing is not supported.
      * <p>
-- 
GitLab