Re-implement model type value for Resource Mapping
[aai/babel.git] / src / main / java / org / onap / aai / babel / xml / generator / model / Widget.java
index e66b06c..2decc8c 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.
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.xml.generator.model;
 
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import org.onap.aai.babel.xml.generator.XmlArtifactGenerationException;
@@ -54,10 +54,10 @@ public class Widget extends Model {
     }
 
     /**
-     * Copy Constructor
+     * Copy Constructor.
      * 
      * @param baseWidget
-     * @throws XmlArtifactGenerationException 
+     * @throws XmlArtifactGenerationException
      */
     public Widget(Widget baseWidget) throws XmlArtifactGenerationException {
         this(baseWidget.getWidgetType(), baseWidget.getName(), baseWidget.getDeleteFlag());
@@ -75,7 +75,8 @@ public class Widget extends Model {
      * @param type
      *            the type
      * @return a new widget of the specified type
-     * @throws XmlArtifactGenerationException 
+     * @throws XmlArtifactGenerationException
+     *             if there is no configuration defined for the specified type
      */
     public static Widget getWidget(Type type) throws XmlArtifactGenerationException {
         Widget widget = WidgetConfigurationUtil.createWidgetFromType(type);
@@ -85,11 +86,6 @@ public class Widget extends Model {
         return widget;
     }
 
-    @Override
-    public boolean isResource() {
-        return false;
-    }
-
     public String getId() {
         String id = WidgetConfigurationUtil.getConfig()
                 .getProperty(ArtifactType.AAI.name() + ".model-version-id." + getName());
@@ -185,11 +181,6 @@ public class Widget extends Model {
         return true;
     }
 
-    @Override
-    public Map<String, Object> getProperties() {
-        return Collections.emptyMap();
-    }
-
     @Override
     public String toString() {
         return getName() + " Widget keys=" + keys + ", resources=" + resources + ", widgets=" + widgets;
@@ -199,4 +190,20 @@ public class Widget extends Model {
     public boolean getDeleteFlag() {
         return deleteFlag;
     }
+
+    @Override
+    public String getModelTypeName() {
+        throw new IllegalAccessException(GENERATOR_AAI_ERROR_UNSUPPORTED_WIDGET_OPERATION);
+    }
+
+    @Override
+    public String getModelId() {
+        throw new IllegalAccessException(GENERATOR_AAI_ERROR_UNSUPPORTED_WIDGET_OPERATION);
+    }
+
+    @Override
+    public String getModelNameVersionId() {
+        throw new IllegalAccessException(GENERATOR_AAI_ERROR_UNSUPPORTED_WIDGET_OPERATION);
+    }
+
 }