Remove yang-test
[controller.git] / opendaylight / config / config-manager-facade-xml / src / main / java / org / opendaylight / controller / config / facade / xml / mapping / attributes / AttributeIfcSwitchStatement.java
index 8ee33c96504945494b48bc63bdef94edb3efe2c0..36a41d04419bb779c31f90cd14e800aace728525 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -24,7 +24,8 @@ public abstract class AttributeIfcSwitchStatement<T> {
 
     private AttributeIfc lastAttribute;
 
-    public T switchAttribute(AttributeIfc attributeIfc) {
+    @SuppressWarnings("checkstyle:avoidHidingCauseException")
+    public T switchAttribute(final AttributeIfc attributeIfc) {
 
         this.lastAttribute = attributeIfc;
 
@@ -32,18 +33,18 @@ public abstract class AttributeIfcSwitchStatement<T> {
 
         if (attributeIfc instanceof JavaAttribute) {
             try {
-                if(((JavaAttribute)attributeIfc).getTypeDefinition() instanceof BinaryTypeDefinition) {
+                if (((JavaAttribute) attributeIfc).getTypeDefinition() instanceof BinaryTypeDefinition) {
                     return caseJavaBinaryAttribute(openType);
-                } else if(((JavaAttribute)attributeIfc).isUnion()) {
+                } else if (((JavaAttribute) attributeIfc).isUnion()) {
                     return caseJavaUnionAttribute(openType);
-                } else if(((JavaAttribute)attributeIfc).isIdentityRef()) {
+                } else if (((JavaAttribute) attributeIfc).isIdentityRef()) {
                     return caseJavaIdentityRefAttribute(openType);
-                } else if(((JavaAttribute)attributeIfc).isEnum()) {
+                } else if (((JavaAttribute) attributeIfc).isEnum()) {
                     return caseJavaEnumAttribute(openType);
                 } else {
                     return caseJavaAttribute(openType);
                 }
-            } catch (UnknownOpenTypeException e) {
+            } catch (final UnknownOpenTypeException e) {
                 throw getIllegalArgumentException(attributeIfc);
             }
 
@@ -64,28 +65,28 @@ public abstract class AttributeIfcSwitchStatement<T> {
         return lastAttribute;
     }
 
-    protected T caseJavaIdentityRefAttribute(OpenType<?> openType) {
+    protected T caseJavaIdentityRefAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    protected T caseJavaUnionAttribute(OpenType<?> openType) {
+    protected T caseJavaUnionAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    protected T caseJavaEnumAttribute(OpenType<?> openType) {
+    protected T caseJavaEnumAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    protected T caseJavaBinaryAttribute(OpenType<?> openType) {
+    protected T caseJavaBinaryAttribute(final OpenType<?> openType) {
         return caseJavaAttribute(openType);
     }
 
-    private IllegalArgumentException getIllegalArgumentException(AttributeIfc attributeIfc) {
+    private IllegalArgumentException getIllegalArgumentException(final AttributeIfc attributeIfc) {
         return new IllegalArgumentException("Unknown attribute type " + attributeIfc.getClass() + ", " + attributeIfc
                 + " with open type:" + attributeIfc.getOpenType());
     }
 
-    public final T caseJavaAttribute(OpenType<?> openType) {
+    public final T caseJavaAttribute(final OpenType<?> openType) {
         if (openType instanceof SimpleType<?>) {
             return caseJavaSimpleAttribute((SimpleType<?>) openType);
         } else if (openType instanceof ArrayType<?>) {
@@ -114,7 +115,7 @@ public abstract class AttributeIfcSwitchStatement<T> {
     private static class UnknownOpenTypeException extends RuntimeException {
         private static final long serialVersionUID = 1L;
 
-        public UnknownOpenTypeException(String message) {
+        UnknownOpenTypeException(final String message) {
             super(message);
         }
     }