Improve test coverage
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / enums / ComponentTypeEnum.java
index d155240..e4e689a 100644 (file)
 
 package org.openecomp.sdc.be.datatypes.enums;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
 public enum ComponentTypeEnum {
     RESOURCE("Resource"),
     SERVICE("Service"),
@@ -22,37 +27,12 @@ public enum ComponentTypeEnum {
     PRODUCT("Product"),
     SERVICE_INSTANCE("Service Instance");
 
-    private String value;
-
-    ComponentTypeEnum(String value) {
-        this.value = value;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
     // Those values cannot be another field in enum, because they are needed
     // as constants for Swagger allowedValues param
     public static final String RESOURCE_PARAM_NAME = "resources";
     public static final String SERVICE_PARAM_NAME = "services";
     public static final String PRODUCT_PARAM_NAME = "products";
-
-    public NodeTypeEnum getNodeType() {
-
-        switch (this) {
-            case RESOURCE:
-                return NodeTypeEnum.Resource;
-            case SERVICE:
-                return NodeTypeEnum.Service;
-            case PRODUCT:
-                return NodeTypeEnum.Product;
-            case RESOURCE_INSTANCE:
-                return NodeTypeEnum.ResourceInstance;
-            default:
-                throw new UnsupportedOperationException("No nodeType is defined for: " + this.getValue());
-        }
-    }
+    private final String value;
 
     public static ComponentTypeEnum findByValue(String value) {
         ComponentTypeEnum ret = null;
@@ -104,4 +84,20 @@ public enum ComponentTypeEnum {
         }
         return ret;
     }
+
+    public NodeTypeEnum getNodeType() {
+
+        switch (this) {
+            case RESOURCE:
+                return NodeTypeEnum.Resource;
+            case SERVICE:
+                return NodeTypeEnum.Service;
+            case PRODUCT:
+                return NodeTypeEnum.Product;
+            case RESOURCE_INSTANCE:
+                return NodeTypeEnum.ResourceInstance;
+            default:
+                throw new UnsupportedOperationException("No nodeType is defined for: " + this.getValue());
+        }
+    }
 }