Working on model annotations; still in progress.
diff --git a/core/api/src/main/java/org/onlab/onos/net/AbstractModel.java b/core/api/src/main/java/org/onlab/onos/net/AbstractModel.java
index cbafad9..6bdda72 100644
--- a/core/api/src/main/java/org/onlab/onos/net/AbstractModel.java
+++ b/core/api/src/main/java/org/onlab/onos/net/AbstractModel.java
@@ -1,33 +1,32 @@
package org.onlab.onos.net;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
import org.onlab.onos.net.provider.ProviderId;
import java.util.Map;
-import java.util.Set;
/**
* Base implementation of a network model entity.
*/
-public class AbstractModel implements Provided, Annotated {
+public class AbstractModel extends AbstractAnnotated implements Provided {
private final ProviderId providerId;
- // FIXME: figure out whether to make this concurrent or immutable
- private final Map<String, String> annotations = Maps.newHashMap();
-
// For serialization
public AbstractModel() {
providerId = null;
}
/**
- * Creates a model entity attributed to the specified provider.
+ * Creates a model entity attributed to the specified provider and
+ * optionally annotated.
*
- * @param providerId identity of the provider
+ * @param providerId identity of the provider
+ * @param annotations optional key/value annotations
*/
- protected AbstractModel(ProviderId providerId) {
+ @SafeVarargs
+ protected AbstractModel(ProviderId providerId,
+ Map<String, String>... annotations) {
+ super(annotations);
this.providerId = providerId;
}
@@ -36,13 +35,4 @@
return providerId;
}
- @Override
- public Set<String> annotationKeys() {
- return ImmutableSet.copyOf(annotations.keySet());
- }
-
- @Override
- public String annotation(String key) {
- return annotations.get(key);
- }
}