Author: simonetripodi
Date: Thu Jan 21 13:37:47 2010
New Revision: 901699
URL: http://svn.apache.org/viewvc?rev=901699&view=rev
Log:
added equals() and toString() methods to Catalog class
Modified:
commons/sandbox/at-digester/trunk/src/test/org/apache/commons/digester/annotations/catalog/Catalog.java
Modified:
commons/sandbox/at-digester/trunk/src/test/org/apache/commons/digester/annotations/catalog/Catalog.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/at-digester/trunk/src/test/org/apache/commons/digester/annotations/catalog/Catalog.java?rev=901699&r1=901698&r2=901699&view=diff
==============================================================================
---
commons/sandbox/at-digester/trunk/src/test/org/apache/commons/digester/annotations/catalog/Catalog.java
(original)
+++
commons/sandbox/at-digester/trunk/src/test/org/apache/commons/digester/annotations/catalog/Catalog.java
Thu Jan 21 13:37:47 2010
@@ -40,6 +40,32 @@
this.items.add(item);
}
+ public List<Item> getItems() {
+ return this.items;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Catalog other = (Catalog) obj;
+ if (this.items == null) {
+ if (other.getItems() != null)
+ return false;
+ } else if (!this.items.equals(other.getItems()))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "Catalog [items=" + items + "]";
+ }
+
public void print() {
System.out.println("This catalog has " + this.items.size() + " items");