Fix checkstyle warnings for config-netconf-connector
[controller.git] / opendaylight / netconf / config-netconf-connector / src / main / java / org / opendaylight / controller / netconf / confignetconfconnector / mapping / attributes / fromxml / AttributeConfigElement.java
index dbc1b48d4f9abebe5fc89c306f65b68fcee924d2..2d5a72b0feefe800b1902b0bf0fd65c319228d55 100644 (file)
@@ -9,24 +9,24 @@
 package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml;
 
 import com.google.common.base.Optional;
-import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.resolving.AttributeResolvingStrategy;
-
 import javax.management.openmbean.OpenType;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.resolving.AttributeResolvingStrategy;
 
 /**
  * Parsed xml element containing configuration for one attribute of an instance
  * of some module. Contains default value extracted from yang file.
  */
 public class AttributeConfigElement {
-    private final Object dafaultValue;
+    private final Object defaultValue;
     private final Object value;
 
     private Optional<?> resolvedValue;
     private Object resolvedDefaultValue;
     private String jmxName;
 
-    public AttributeConfigElement(Object dafaultValue, Object value) {
-        this.dafaultValue = dafaultValue;
+    public AttributeConfigElement(Object defaultValue, Object value) {
+        this.defaultValue = defaultValue;
         this.value = value;
     }
 
@@ -39,9 +39,9 @@ public class AttributeConfigElement {
     }
 
     public void resolveValue(AttributeResolvingStrategy<?, ? extends OpenType<?>> attributeResolvingStrategy,
-            String attrName) {
+            String attrName) throws NetconfDocumentedException {
         resolvedValue = attributeResolvingStrategy.parseAttribute(attrName, value);
-        Optional<?> resolvedDefault = attributeResolvingStrategy.parseAttribute(attrName, dafaultValue);
+        Optional<?> resolvedDefault = attributeResolvingStrategy.parseAttribute(attrName, defaultValue);
         resolvedDefaultValue = resolvedDefault.isPresent() ? resolvedDefault.get() : null;
     }
 
@@ -57,6 +57,10 @@ public class AttributeConfigElement {
         return value;
     }
 
+    public Object getDefaultValue() {
+        return defaultValue;
+    }
+
     public Optional<?> getResolvedValue() {
         return resolvedValue;
     }
@@ -67,7 +71,7 @@ public class AttributeConfigElement {
 
     @Override
     public String toString() {
-        return "AttributeConfigElement [dafaultValue=" + dafaultValue + ", value=" + value + "]";
+        return "AttributeConfigElement [defaultValue=" + defaultValue + ", value=" + value + "]";
     }
 
 }