Reimplement Widget.Type enum class
[aai/babel.git] / src / main / java / org / onap / aai / babel / xml / generator / model / Model.java
index c67d67f..ea1d478 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2019 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@ import java.util.Optional;
 import java.util.Set;
 import org.onap.aai.babel.xml.generator.XmlArtifactGenerationException;
 import org.onap.aai.babel.xml.generator.data.WidgetConfigurationUtil;
-import org.onap.aai.babel.xml.generator.model.Widget.Type;
 
 public abstract class Model {
 
@@ -99,9 +98,9 @@ public abstract class Model {
         public abstract void populate(Model model, String value);
     }
 
-    private String modelId;
+    private String modelId; // model-invariant-id
     private String modelName;
-    private String modelNameVersionId;
+    private String modelNameVersionId; // model-version-id
     private String modelVersion;
     private String modelDescription;
 
@@ -148,9 +147,9 @@ public abstract class Model {
      */
     public static Resource getModelFor(String toscaType, String metaDataType) {
         if ("Configuration".equals(metaDataType)) {
-            return new Resource(Type.CONFIGURATION, true);
+            return new Resource(WidgetType.valueOf("CONFIGURATION"), true);
         } else if ("CR".equals(metaDataType)) {
-            return new Resource(Type.CR, true);
+            return new Resource(WidgetType.valueOf("CR"), true);
         } else {
             return getModelFor(toscaType);
         }
@@ -158,7 +157,7 @@ public abstract class Model {
 
     public abstract boolean addWidget(Widget resource) throws XmlArtifactGenerationException;
 
-    public abstract Widget.Type getWidgetType();
+    public abstract WidgetType getWidgetType();
 
     public abstract String getModelTypeName();