Fix checkstyle warnings in yang-jmx-generator.
[controller.git] / opendaylight / config / yang-jmx-generator / src / main / java / org / opendaylight / controller / config / yangjmxgenerator / attribute / TOAttribute.java
index cbeb5c3b297415bacf1a74596abbbf8d4fb9d207..91016d4100b6ba6e3fffe871ecbb1b7cb546d08c 100644 (file)
@@ -11,6 +11,15 @@ import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
 import org.opendaylight.controller.config.yangjmxgenerator.TypeProviderWrapper;
 import org.opendaylight.yangtools.binding.generator.util.ReferencedTypeImpl;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
@@ -22,16 +31,6 @@ import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
 public class TOAttribute extends AbstractAttribute implements TypedAttribute {
 
     private final String nullableDescription, nullableDefault;
@@ -73,18 +72,19 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute {
             TypeProviderWrapper typeProviderWrapper, String packageName) {
         Class<? extends DataSchemaNode> 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 +92,9 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute {
     private static Class<? extends DataSchemaNode> isAllowedType(
             DataSchemaNode dataSchemaNode) {
         for (Class<? extends DataSchemaNode> 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 +157,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;
     }