equality based on the ids of the contents of SingleRouterConfig.
[xmlrouter] / config / src / main / java / org / wamblee / xmlrouter / config / Config.java
index b12210b1b841a5ac52af7dec6cdcd9a1607eea67..baa4c8b4d72d0f6d2c38bba418ba7f354882721c 100644 (file)
@@ -15,7 +15,7 @@
  */
 package org.wamblee.xmlrouter.config;
 
-import java.util.List;
+import java.util.Collection;
 
 import org.wamblee.xmlrouter.common.Id;
 
@@ -28,15 +28,14 @@ import org.wamblee.xmlrouter.common.Id;
  * @param <T>
  *            Type for which ids are generated.
  */
-public interface Config<T> extends Identifiable<Config> {
-
-    // TODO define what happens when there is a duplicate item.
-
+public interface Config<T extends Identifiable> extends Identifiable<Config> {
     /**
      * Adds an item. No item with the same id may exist.
      * 
      * @param aT
      *            item
+     * @throws ConfigException
+     *             In case an object with the same id already exists.
      */
     void add(T aT);
 
@@ -52,5 +51,5 @@ public interface Config<T> extends Identifiable<Config> {
     /**
      * @return All available items.
      */
-    List<T> values();
+    Collection<T> values();
 }
\ No newline at end of file