package org.opendaylight.controller.switchmanager.northbound;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.Property;
private Node node;
@XmlElementRef
@XmlElementWrapper
+ @JsonIgnore
private Set<Property> properties;
// JAXB required constructor
this.properties = properties;
}
+ @JsonProperty(value="properties")
+ public Map<String, Property> getMapProperties() {
+ Map<String, Property> map = new HashMap<String, Property>();
+ for (Property p : properties) {
+ map.put(p.getName(), p);
+ }
+ return map;
+ }
+
+ public void setMapProperties(Map<String, Property> propertiesMap) {
+ this.properties = new HashSet<Property>(propertiesMap.values());
+ }
+
public Set<Property> getProperties() {
return properties;
}