First version after introduction of meaningful ids and Identifiable interface.
[xmlrouter] / config / src / main / java / org / wamblee / xmlrouter / config / Config.java
index 263b0b66bfe7c0fbad9087dc6c8b2de21462cbdd..39ecfaefe0c179ab3a5aecc13fecbf94f356a661 100644 (file)
@@ -15,7 +15,7 @@
  */
 package org.wamblee.xmlrouter.config;
 
-import java.util.Map;
+import java.util.List;
 
 import org.wamblee.xmlrouter.common.Id;
 
@@ -28,16 +28,15 @@ import org.wamblee.xmlrouter.common.Id;
  * @param <T>
  *            Type for which ids are generated.
  */
-public interface Config<T> {
+public interface Config<T> extends Identifiable<Config> {
 
     /**
-     * Adds a item
+     * Adds an item. No item with the same id may exist.
      * 
      * @param aT
      *            item
-     * @return Unique id.
      */
-    Id<T> add(T aT);
+    void add(T aT);
 
     /**
      * Removes the item with a given id.
@@ -49,7 +48,7 @@ public interface Config<T> {
     boolean remove(Id<T> aId);
 
     /**
-     * @return All available ids.
+     * @return All available items.
      */
-    Map<Id<T>, T> map();
+    List<T> values();
 }
\ No newline at end of file