Added support to generate interfaces from Choices and Cases.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-java-api-generator / src / main / java / org / opendaylight / controller / sal / java / api / generator / EnumGenerator.java
index 33d2917339a389c9d411af9e9b5ce5a90bd48796..760365d171ae3fcf017537978c2f915269cd50a6 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.controller.sal.java.api.generator;
 
-import static org.opendaylight.controller.sal.java.api.generator.Constants.*;
+import static org.opendaylight.controller.sal.java.api.generator.Constants.NL;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -19,30 +19,29 @@ import org.opendaylight.controller.sal.binding.model.api.Type;
 
 public class EnumGenerator implements CodeGenerator {
 
-       @Override
-       public Writer generate(Type type) throws IOException {
-               final Writer writer = new StringWriter();
+    @Override
+    public Writer generate(Type type) throws IOException {
+        final Writer writer = new StringWriter();
 
-               if (type instanceof Enumeration) {
-                       Enumeration enums = (Enumeration) type;
-                       writer.write(GeneratorUtil.createPackageDeclaration(enums
-                                       .getPackageName()));
-                       writer.write(NL + NL);
-                       writer.write(GeneratorUtil.createEnum(enums, ""));
-               }
+        if (type instanceof Enumeration) {
+            Enumeration enums = (Enumeration) type;
+            writer.write(GeneratorUtil.createPackageDeclaration(enums.getPackageName()));
+            writer.write(NL + NL);
+            writer.write(GeneratorUtil.createEnum(enums, ""));
+        }
 
-               return writer;
-       }
+        return writer;
+    }
 
-       public Writer generateInnerEnumeration(Type type, String indent) throws IOException {
-               final Writer writer = new StringWriter();
+    public Writer generateInnerEnumeration(Type type, String indent) throws IOException {
+        final Writer writer = new StringWriter();
 
-               if (type instanceof Enumeration) {
-                       Enumeration enums = (Enumeration) type;
-                       writer.write(GeneratorUtil.createEnum(enums, indent));
-               }
+        if (type instanceof Enumeration) {
+            Enumeration enums = (Enumeration) type;
+            writer.write(GeneratorUtil.createEnum(enums, indent));
+        }
 
-               return writer;
-       }
+        return writer;
+    }
 
 }