Fix checkstyle issues including javadoc
[aai/babel.git] / src / main / java / org / onap / aai / babel / xml / generator / model / Widget.java
index d78e2e6..be84526 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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.
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import org.onap.aai.babel.logging.ApplicationMsgs;
@@ -42,24 +43,7 @@ public abstract class Widget extends Model {
             "Cannot generate artifacts. Widget configuration not found for %s";
 
     public enum Type {
-        SERVICE,
-        VF,
-        VFC,
-        VSERVER,
-        VOLUME,
-        FLAVOR,
-        TENANT,
-        VOLUME_GROUP,
-        LINT,
-        L3_NET,
-        VFMODULE,
-        IMAGE,
-        OAM_NETWORK,
-        ALLOTTED_RESOURCE,
-        TUNNEL_XCONNECT,
-        CONFIGURATION,
-        CR,
-        INSTANCE_GROUP;
+        SERVICE, VF, VFC, VSERVER, VOLUME, FLAVOR, TENANT, VOLUME_GROUP, LINT, L3_NET, VFMODULE, IMAGE, OAM_NETWORK, ALLOTTED_RESOURCE, TUNNEL_XCONNECT, CONFIGURATION, CR, INSTANCE_GROUP;
     }
 
     private static Logger log = LogHelper.INSTANCE;
@@ -91,7 +75,8 @@ public abstract class Widget extends Model {
     /**
      * Gets widget.
      *
-     * @param type the type
+     * @param type
+     *            the type
      * @return the widget
      */
     public static Widget getWidget(Type type) {
@@ -108,9 +93,14 @@ public abstract class Widget extends Model {
         return widget;
     }
 
+    @Override
+    public boolean isResource() {
+        return false;
+    }
+
     public String getId() {
-        Properties properties = WidgetConfigurationUtil.getConfig();
-        String id = properties.getProperty(ArtifactType.AAI.name() + ".model-version-id." + getName());
+        String id = WidgetConfigurationUtil.getConfig()
+                .getProperty(ArtifactType.AAI.name() + ".model-version-id." + getName());
         if (id == null) {
             throw new IllegalArgumentException(String.format(GENERATOR_AAI_CONFIGLPROP_NOT_FOUND,
                     ArtifactType.AAI.name() + ".model-version-id." + getName()));
@@ -124,8 +114,7 @@ public abstract class Widget extends Model {
     }
 
     public String getName() {
-        ModelWidget widgetModel = this.getClass().getAnnotation(ModelWidget.class);
-        return widgetModel.name();
+        return this.getClass().getAnnotation(ModelWidget.class).name();
     }
 
     /**
@@ -157,7 +146,8 @@ public abstract class Widget extends Model {
     /**
      * Equals method that compares Widget IDs.
      *
-     * @param obj the Widget object to compare
+     * @param obj
+     *            the Widget object to compare
      * @return whether or not obj is equal to this Widget
      */
     @Override
@@ -180,7 +170,8 @@ public abstract class Widget extends Model {
     /**
      * Determine whether one or more keys belonging to this Widget appear in the specified Collection.
      *
-     * @param keys the keys
+     * @param keys
+     *            the keys
      * @return the boolean
      */
     public boolean memberOf(Collection<String> keys) {
@@ -199,4 +190,9 @@ public abstract class Widget extends Model {
     public boolean addWidget(Widget widget) {
         return true;
     }
+
+    @Override
+    public Map<String, Object> getProperties() {
+        return Collections.emptyMap();
+    }
 }