X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2Fattribute%2FTOAttribute.java;h=e563da1328a210f82b44f498b08fd9c73348cfd3;hp=cbeb5c3b297415bacf1a74596abbbf8d4fb9d207;hb=0a16f37f1baa4a2616e9b7289a445649b4f3132d;hpb=808313e2a87d8dd037a0566574d0acc34687149c diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java index cbeb5c3b29..e563da1328 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java @@ -73,18 +73,19 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute { TypeProviderWrapper typeProviderWrapper, String packageName) { Class type = isAllowedType(dataSchemaNode); - if (type.equals(LeafSchemaNode.class)) + if (type.equals(LeafSchemaNode.class)) { return new JavaAttribute((LeafSchemaNode) dataSchemaNode, typeProviderWrapper); - else if (type.equals(ListSchemaNode.class)) + } else if (type.equals(ListSchemaNode.class)) { return ListAttribute.create((ListSchemaNode) dataSchemaNode, typeProviderWrapper, packageName); - else if (type.equals(LeafListSchemaNode.class)) + } else if (type.equals(LeafListSchemaNode.class)) { return ListAttribute.create((LeafListSchemaNode) dataSchemaNode, typeProviderWrapper); - else if (type.equals(ContainerSchemaNode.class)) + } else if (type.equals(ContainerSchemaNode.class)) { return TOAttribute.create((ContainerSchemaNode) dataSchemaNode, typeProviderWrapper, packageName); + } throw new IllegalStateException("This should never happen"); } @@ -92,8 +93,9 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute { private static Class isAllowedType( DataSchemaNode dataSchemaNode) { for (Class allowedType : ALLOWED_CHILDREN) { - if (allowedType.isAssignableFrom(dataSchemaNode.getClass()) == true) + if (allowedType.isAssignableFrom(dataSchemaNode.getClass()) == true) { return allowedType; + } } throw new IllegalArgumentException("Illegal child node for TO: " + dataSchemaNode.getClass() + " allowed node types: " @@ -156,26 +158,32 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute { @Override public boolean equals(Object o) { - if (this == o) + if (this == o) { return true; - if (o == null || getClass() != o.getClass()) + } + if (o == null || getClass() != o.getClass()) { return false; - if (!super.equals(o)) + } + if (!super.equals(o)) { return false; + } TOAttribute that = (TOAttribute) o; if (nullableDefault != null ? !nullableDefault - .equals(that.nullableDefault) : that.nullableDefault != null) + .equals(that.nullableDefault) : that.nullableDefault != null) { return false; + } if (nullableDescription != null ? !nullableDescription .equals(that.nullableDescription) - : that.nullableDescription != null) + : that.nullableDescription != null) { return false; + } if (yangNameToAttributeMap != null ? !yangNameToAttributeMap .equals(that.yangNameToAttributeMap) - : that.yangNameToAttributeMap != null) + : that.yangNameToAttributeMap != null) { return false; + } return true; }