Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
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
diff --git
a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java
b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java
index 598935a0bc4f15ddcc61039723e313d55c0d9860..2d5a72b0feefe800b1902b0bf0fd65c319228d55 100644
(file)
--- a/
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java
+++ b/
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AttributeConfigElement.java
@@
-9,25
+9,24
@@
package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml;
import com.google.common.base.Optional;
package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml;
import com.google.common.base.Optional;
-import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
-import org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.resolving.AttributeResolvingStrategy;
-
import javax.management.openmbean.OpenType;
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 {
/**
* 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 d
a
faultValue;
+ private final Object d
e
faultValue;
private final Object value;
private Optional<?> resolvedValue;
private Object resolvedDefaultValue;
private String jmxName;
private final Object value;
private Optional<?> resolvedValue;
private Object resolvedDefaultValue;
private String jmxName;
- public AttributeConfigElement(Object d
a
faultValue, Object value) {
- this.d
afaultValue = da
faultValue;
+ public AttributeConfigElement(Object d
e
faultValue, Object value) {
+ this.d
efaultValue = de
faultValue;
this.value = value;
}
this.value = value;
}
@@
-40,35
+39,28
@@
public class AttributeConfigElement {
}
public void resolveValue(AttributeResolvingStrategy<?, ? extends OpenType<?>> attributeResolvingStrategy,
}
public void resolveValue(AttributeResolvingStrategy<?, ? extends OpenType<?>> attributeResolvingStrategy,
- String attrName) {
+ String attrName)
throws NetconfDocumentedException
{
resolvedValue = attributeResolvingStrategy.parseAttribute(attrName, value);
resolvedValue = attributeResolvingStrategy.parseAttribute(attrName, value);
- Optional<?> resolvedDefault = attributeResolvingStrategy.parseAttribute(attrName, d
a
faultValue);
+ Optional<?> resolvedDefault = attributeResolvingStrategy.parseAttribute(attrName, d
e
faultValue);
resolvedDefaultValue = resolvedDefault.isPresent() ? resolvedDefault.get() : null;
resolvedDefaultValue = resolvedDefault.isPresent() ? resolvedDefault.get() : null;
-
- }
-
- public static AttributeConfigElement create(AttributeIfc attributeIfc, Object value) {
- String nullableDefault = attributeIfc.getNullableDefault();
- return create(nullableDefault, value);
}
}
- public static AttributeConfigElement create(
String
nullableDefault, Object value) {
+ public static AttributeConfigElement create(
Object
nullableDefault, Object value) {
return new AttributeConfigElement(nullableDefault, value);
}
return new AttributeConfigElement(nullableDefault, value);
}
- public static AttributeConfigElement createNullValue(AttributeIfc attributeIfc) {
- return new AttributeConfigElement(attributeIfc.getNullableDefault(), null);
- }
-
- public static AttributeConfigElement createNullValue(String nullableDefault) {
+ public static AttributeConfigElement createNullValue(Object nullableDefault) {
return new AttributeConfigElement(nullableDefault, null);
}
return new AttributeConfigElement(nullableDefault, null);
}
-
public Object getValue() {
return value;
}
public Object getValue() {
return value;
}
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
public Optional<?> getResolvedValue() {
return resolvedValue;
}
public Optional<?> getResolvedValue() {
return resolvedValue;
}
@@
-79,7
+71,7
@@
public class AttributeConfigElement {
@Override
public String toString() {
@Override
public String toString() {
- return "AttributeConfigElement [d
afaultValue=" + da
faultValue + ", value=" + value + "]";
+ return "AttributeConfigElement [d
efaultValue=" + de
faultValue + ", value=" + value + "]";
}
}
}
}