more TODOs in the code.
[xmlrouter] / config / src / main / java / org / wamblee / xmlrouter / config / Config.java
index b90b34c4bfb58a0739d760d0b545a139bf19df0c..b12210b1b841a5ac52af7dec6cdcd9a1607eea67 100644 (file)
  */
 package org.wamblee.xmlrouter.config;
 
-import java.util.Collection;
+import java.util.List;
 
 import org.wamblee.xmlrouter.common.Id;
 
 /**
- * Basic configuration interface for managing a set of configuration items of a
- * given type with unique ids.
+ * Interface for managing a set of configuration items of a given type with
+ * unique ids.
  * 
  * @author Erik Brakkee
  * 
  * @param <T>
  *            Type for which ids are generated.
  */
-public interface Config<T> {
+public interface Config<T> extends Identifiable<Config> {
+
+    // TODO define what happens when there is a duplicate item.
 
     /**
-     * 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,17 +50,7 @@ public interface Config<T> {
     boolean remove(Id<T> aId);
 
     /**
-     * @return All available ids.
-     */
-    Collection<Id<T>> ids();
-
-    /**
-     * Gets the item for the given id.
-     * 
-     * @param aId
-     *            Item id.
-     * @return Item, or null if not found.
+     * @return All available items.
      */
-    T get(Id<T> aId);
-
+    List<T> values();
 }
\ No newline at end of file