Use lombok annotations in gui 79/122679/1
authorJim Hahn <jrh3@att.com>
Fri, 16 Jul 2021 14:04:54 +0000 (10:04 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 16 Jul 2021 14:05:16 +0000 (10:05 -0400)
Issue-ID: POLICY-3395
Change-Id: I7820877522875a3caf47e3b7409eb4f7fb15ba2b
Signed-off-by: Jim Hahn <jrh3@att.com>
18 files changed:
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/ContextAlbumHandler.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/EventHandler.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/TaskHandler.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanContextAlbum.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanEvent.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanField.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanKeyRef.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanLogic.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanPolicy.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanState.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanStateOutput.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanStateTaskRef.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanTask.java
gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/bean/BeanTaskParameter.java
gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/RestSessionTest.java
gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/bean/DummyBeanBase.java
gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java
gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java

index ffe445c..50a61e5 100644 (file)
@@ -109,7 +109,7 @@ public class ContextAlbumHandler implements RestCommandHandler {
         final var jsonbean = RestUtils.getJsonParameters(jsonString, BeanContextAlbum.class);
 
         ApexApiResult result = session.getApexModelEdited().createContextAlbum(jsonbean.getName(),
-            jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.getWriteable()),
+            jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.isWriteable()),
             jsonbean.getItemSchema().getName(), jsonbean.getItemSchema().getVersion(), jsonbean.getUuid(),
             jsonbean.getDescription());
 
@@ -137,7 +137,7 @@ public class ContextAlbumHandler implements RestCommandHandler {
         final var jsonbean = RestUtils.getJsonParameters(jsonString, BeanContextAlbum.class);
 
         ApexApiResult result = session.getApexModelEdited().updateContextAlbum(jsonbean.getName(),
-            jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.getWriteable()),
+            jsonbean.getVersion(), jsonbean.getScope(), Boolean.toString(jsonbean.isWriteable()),
             jsonbean.getItemSchema().getName(), jsonbean.getItemSchema().getVersion(), jsonbean.getUuid(),
             jsonbean.getDescription());
 
index 0adfffa..a66ce63 100644 (file)
@@ -150,7 +150,7 @@ public class EventHandler implements RestCommandHandler {
 
             final ApexApiResult createParResult = session.getApexModelEdited().createEventPar(jsonbean.getName(),
                 jsonbean.getVersion(), parameterEntry.getKey(), parameterEntry.getValue().getName(),
-                parameterEntry.getValue().getVersion(), parameterEntry.getValue().getOptional());
+                parameterEntry.getValue().getVersion(), parameterEntry.getValue().isOptional());
             if (createParResult.isNok()) {
                 result.setResult(createParResult.getResult());
                 result.addMessage("Failed to add event parameter information for parameter \"" + parameterEntry.getKey()
index ed7f915..848a117 100644 (file)
@@ -191,7 +191,7 @@ public class TaskHandler implements RestCommandHandler {
             } else {
                 ApexApiResult fieldCreationResult = session.getApexModelEdited().createTaskInputField(
                     jsonbean.getName(), jsonbean.getVersion(), fieldEntry.getKey(), fieldEntry.getValue().getName(),
-                    fieldEntry.getValue().getVersion(), fieldEntry.getValue().getOptional());
+                    fieldEntry.getValue().getVersion(), fieldEntry.getValue().isOptional());
 
                 if (fieldCreationResult.isNok()) {
                     result.setResult(fieldCreationResult.getResult());
@@ -240,7 +240,7 @@ public class TaskHandler implements RestCommandHandler {
             } else {
                 ApexApiResult fieldCreationResult = session.getApexModelEdited().createTaskOutputField(
                     jsonbean.getName(), jsonbean.getVersion(), fieldEntry.getKey(), fieldEntry.getValue().getName(),
-                    fieldEntry.getValue().getVersion(), fieldEntry.getValue().getOptional());
+                    fieldEntry.getValue().getVersion(), fieldEntry.getValue().isOptional());
                 if (fieldCreationResult.isNok()) {
                     result.setResult(fieldCreationResult.getResult());
                     result.addMessage("Failed to add task output field information for field \"" + fieldEntry.getKey()
index 51ccafb..1b8634d 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The ContextAlbum Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanContextAlbum extends BeanBase {
     private String name = null;
     private String version = null;
@@ -35,76 +40,4 @@ public class BeanContextAlbum extends BeanBase {
     private String description = null;
     private BeanKeyRef itemSchema = null;
     private boolean writeable;
-
-    /**
-     * Gets the name.
-     *
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the version.
-     *
-     * @return the version
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * Gets the scope.
-     *
-     * @return the scope
-     */
-    public String getScope() {
-        return scope;
-    }
-
-    /**
-     * Gets the uuid.
-     *
-     * @return the uuid
-     */
-    public String getUuid() {
-        return uuid;
-    }
-
-    /**
-     * Gets the description.
-     *
-     * @return the description
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Gets the item schema.
-     *
-     * @return the item schema
-     */
-    public BeanKeyRef getItemSchema() {
-        return itemSchema;
-    }
-
-    /**
-     * Gets the writeable.
-     *
-     * @return the writeable
-     */
-    public boolean getWriteable() {
-        return writeable;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ContextAlbum [name=" + name + ", version=" + version + ", scope=" + scope + ", uuid=" + uuid
-            + ", description=" + description + ", itemSchema=" + itemSchema + ", writeable=" + writeable + "]";
-    }
 }
index 2e14f72..1c20607 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,11 +24,15 @@ package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import java.util.Map;
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The Event Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanEvent extends BeanBase {
     private String name = null;
     private String version = null;
@@ -38,78 +43,6 @@ public class BeanEvent extends BeanBase {
     private String description = null;
     private Map<String, BeanField> parameters = null;
 
-    /**
-     * Gets the name.
-     *
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the version.
-     *
-     * @return the version
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * Gets the name space.
-     *
-     * @return the name space
-     */
-    public String getNameSpace() {
-        return nameSpace;
-    }
-
-    /**
-     * Gets the source.
-     *
-     * @return the source
-     */
-    public String getSource() {
-        return source;
-    }
-
-    /**
-     * Gets the target.
-     *
-     * @return the target
-     */
-    public String getTarget() {
-        return target;
-    }
-
-    /**
-     * Gets the uuid.
-     *
-     * @return the uuid
-     */
-    public String getUuid() {
-        return uuid;
-    }
-
-    /**
-     * Gets the description.
-     *
-     * @return the description
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Gets the parameters.
-     *
-     * @return the parameters
-     */
-    public Map<String, BeanField> getParameters() {
-        return parameters;
-    }
-
     /**
      * Gets the parameter.
      *
@@ -122,15 +55,4 @@ public class BeanEvent extends BeanBase {
         }
         return null;
     }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "Event [name=" + name + ", version=" + version + ", nameSpace=" + nameSpace + ", source=" + source
-            + ", target=" + target + ", uuid=" + uuid + ", description=" + description + ", parameters="
-            + getParameters() + "]";
-    }
-
 }
index 0a9042c..5b1b271 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The Field Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanField extends BeanKeyRef {
 
     private boolean optional = true;
     private String localName = null;
-
-    /**
-     * Gets the local name for this field.
-     *
-     * @return the local name for this field.
-     */
-    public String getLocalName() {
-        return localName;
-    }
-
-    /**
-     * Gets the optional flag.
-     *
-     * @return the optional flag
-     */
-    public boolean getOptional() {
-        return optional;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "Field [localName=" + getLocalName() + ", name=" + getName() + ", version=" + getVersion()
-            + ", optional=" + getOptional() + "]";
-    }
-
 }
index 6238b3c..234c50a 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The Key Reference Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanKeyRef extends BeanBase {
     private String name = null;
     private String version = null;
-
-    /**
-     * Gets the name.
-     *
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the version.
-     *
-     * @return the version
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "KeyRef [name=" + name + ", version=" + version + "]";
-    }
-
 }
index a11b768..c337ea1 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The Logic Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanLogic extends BeanBase {
     private String logic = null;
     private String logicFlavour = null;
-
-    /**
-     * Gets the logic flavour.
-     *
-     * @return the logic flavour
-     */
-    public String getLogicFlavour() {
-        return logicFlavour;
-    }
-
-    /**
-     * Gets the logic.
-     *
-     * @return the logic
-     */
-    public String getLogic() {
-        return logic;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "Logic [logicFlavour=" + logicFlavour + ", logic=" + logic + "]";
-    }
 }
index be67402..7d6cfee 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,11 +24,15 @@ package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import java.util.Map;
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The Policy Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanPolicy extends BeanBase {
     private String name = null;
     private String version = null;
@@ -36,77 +41,4 @@ public class BeanPolicy extends BeanBase {
     private String firstState = null;
     private String template = null;
     private Map<String, BeanState> states = null;
-
-    /**
-     * Gets the name.
-     *
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the version.
-     *
-     * @return the version
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * Gets the uuid.
-     *
-     * @return the uuid
-     */
-    public String getUuid() {
-        return uuid;
-    }
-
-    /**
-     * Gets the description.
-     *
-     * @return the description
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Gets the first state.
-     *
-     * @return the first state
-     */
-    public String getFirstState() {
-        return firstState;
-    }
-
-    /**
-     * Gets the template.
-     *
-     * @return the template
-     */
-    public String getTemplate() {
-        return template;
-    }
-
-    /**
-     * Gets the states.
-     *
-     * @return the states
-     */
-    public Map<String, BeanState> getStates() {
-        return states;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "Policy [name=" + name + ", version=" + version + ", uuid=" + uuid + ", description=" + description
-            + ", firstState=" + firstState + ", template=" + template + ", states=" + states + "]";
-    }
-
 }
index e1a5c68..a5cbafd 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,15 +25,19 @@ package org.onap.policy.gui.editors.apex.rest.handling.bean;
 import java.util.Arrays;
 import java.util.Map;
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * The State Bean.
  */
 @XmlType
+@Getter
 public class BeanState extends BeanBase {
 
     private String name = null;
     private BeanKeyRef trigger = null;
+    @Setter
     private BeanKeyRef defaultTask = null;
     private BeanKeyRef[] contexts = null;
     private BeanLogic taskSelectionLogic = null;
@@ -40,87 +45,6 @@ public class BeanState extends BeanBase {
     private Map<String, BeanLogic> finalizers = null;
     private Map<String, BeanStateOutput> stateOutputs = null;
 
-    /**
-     * Gets the name.
-     *
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the trigger.
-     *
-     * @return the trigger
-     */
-    public BeanKeyRef getTrigger() {
-        return trigger;
-    }
-
-    /**
-     * Gets the contexts.
-     *
-     * @return the contexts
-     */
-    public BeanKeyRef[] getContexts() {
-        return contexts;
-    }
-
-    /**
-     * Gets the task selection logic.
-     *
-     * @return the task selection logic
-     */
-    public BeanLogic getTaskSelectionLogic() {
-        return taskSelectionLogic;
-    }
-
-    /**
-     * Gets the tasks.
-     *
-     * @return the tasks
-     */
-    public Map<String, BeanStateTaskRef> getTasks() {
-        return tasks;
-    }
-
-    /**
-     * Gets the finalizers.
-     *
-     * @return the finalizers
-     */
-    public Map<String, BeanLogic> getFinalizers() {
-        return finalizers;
-    }
-
-    /**
-     * Gets the state outputs.
-     *
-     * @return the state outputs
-     */
-    public Map<String, BeanStateOutput> getStateOutputs() {
-        return stateOutputs;
-    }
-
-    /**
-     * Gets the default task.
-     *
-     * @return the default task
-     */
-    public BeanKeyRef getDefaultTask() {
-        return defaultTask;
-    }
-
-    /**
-     * Sets the default task.
-     *
-     * @param defaultTask the new default task
-     */
-    public void setDefaultTask(final BeanKeyRef defaultTask) {
-        this.defaultTask = defaultTask;
-    }
-
     /**
      * {@inheritDoc}.
      */
index ee4c3fc..7e15eae 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The StateOutput Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanStateOutput extends BeanBase {
 
     private BeanKeyRef event = null;
     private String nextState = null;
-
-    /**
-     * Gets the event.
-     *
-     * @return the event
-     */
-    public BeanKeyRef getEvent() {
-        return event;
-    }
-
-    /**
-     * Gets the next state.
-     *
-     * @return the next state
-     */
-    public String getNextState() {
-        return nextState;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "StateOutput [event=" + event + ", nextState=" + nextState + "]";
-    }
-
 }
index 9b31dad..9b9616d 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The State Task Reference Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanStateTaskRef extends BeanBase {
     private BeanKeyRef task = null;
     private String outputType = null;
     private String outputName = null;
-
-    /**
-     * Gets the task.
-     *
-     * @return the task
-     */
-    public BeanKeyRef getTask() {
-        return task;
-    }
-
-    /**
-     * Gets the output type.
-     *
-     * @return the output type
-     */
-    public String getOutputType() {
-        return outputType;
-    }
-
-    /**
-     * Gets the output name.
-     *
-     * @return the output name
-     */
-    public String getOutputName() {
-        return outputName;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "StateTaskRef [task=" + task + ", outputType=" + outputType + ", outputName=" + outputName + "]";
-    }
-
 }
index 010745e..eebfc92 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,11 +25,13 @@ package org.onap.policy.gui.editors.apex.rest.handling.bean;
 import java.util.Arrays;
 import java.util.Map;
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
 
 /**
  * The Task Bean.
  */
 @XmlType
+@Getter
 public class BeanTask extends BeanBase {
     private String name = null;
     private String version = null;
@@ -40,87 +43,6 @@ public class BeanTask extends BeanBase {
     private Map<String, BeanTaskParameter> parameters = null;
     private BeanKeyRef[] contexts = null;
 
-    /**
-     * Gets the name.
-     *
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the version.
-     *
-     * @return the version
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * Gets the uuid.
-     *
-     * @return the uuid
-     */
-    public String getUuid() {
-        return uuid;
-    }
-
-    /**
-     * Gets the description.
-     *
-     * @return the description
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Gets the task logic.
-     *
-     * @return the task logic
-     */
-    public BeanLogic getTaskLogic() {
-        return taskLogic;
-    }
-
-    /**
-     * Gets the input fields.
-     *
-     * @return the input fields
-     */
-    public Map<String, BeanField> getInputFields() {
-        return inputFields;
-    }
-
-    /**
-     * Gets the output fields.
-     *
-     * @return the output fields
-     */
-    public Map<String, BeanField> getOutputFields() {
-        return outputFields;
-    }
-
-    /**
-     * Gets the parameters.
-     *
-     * @return the parameters
-     */
-    public Map<String, BeanTaskParameter> getParameters() {
-        return parameters;
-    }
-
-    /**
-     * Gets the contexts.
-     *
-     * @return the contexts
-     */
-    public BeanKeyRef[] getContexts() {
-        return contexts;
-    }
-
     /**
      * {@inheritDoc}.
      */
index 5210a48..d38e6b3 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
+import lombok.ToString;
 
 /**
  * The Task Parameter Bean.
  */
 @XmlType
+@Getter
+@ToString
 public class BeanTaskParameter extends BeanBase {
 
     private String parameterName = null;
     private String defaultValue = null;
-
-    /**
-     * Gets the parameter name.
-     *
-     * @return the parameter name
-     */
-    public String getParameterName() {
-        return parameterName;
-    }
-
-    /**
-     * Gets the default value.
-     *
-     * @return the default value
-     */
-    public String getDefaultValue() {
-        return defaultValue;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "TaskParameter [parameterName=" + parameterName + ", defaultValue=" + defaultValue + "]";
-    }
-
 }
index 8717198..b2158ce 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -100,6 +101,7 @@ public class RestSessionTest {
         final var apexModel = restSession.getApexModel();
         assertThat(apexApiResult.isOk()).isTrue();
         assertThat(original).isNull();
+        assertThat(apexModelEdited).isNotNull();
         assertThat(apexModel).isNotNull();
     }
 
index edb240b..79092a7 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +23,7 @@
 package org.onap.policy.gui.editors.apex.rest.handling.bean;
 
 import javax.xml.bind.annotation.XmlType;
+import lombok.Getter;
 
 /**
  * The Event Bean.
@@ -29,6 +31,7 @@ import javax.xml.bind.annotation.XmlType;
 @XmlType
 public class DummyBeanBase extends BeanBase {
     private String name = null;
+    @Getter
     private String version = null;
     private String field1 = null;
     private int field2 = 0;
@@ -39,10 +42,6 @@ public class DummyBeanBase extends BeanBase {
         return field1;
     }
 
-    public String getVersion() {
-        return version;
-    }
-
     public int getField2() {
         field3 = field2;
         return field3;
index 385e2b5..398cbc4 100644 (file)
@@ -105,7 +105,7 @@ public class PdpMonitoringMain {
             pdpMonitoringServer = new PdpMonitoringServer(parameters);
 
             // Add a shutdown hook to shut down the servlet services when the process is exiting
-            Runtime.getRuntime().addShutdownHook(new Thread(new PdpServicesShutdownHook()));
+            Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown));
 
             state = ServicesState.RUNNING;
 
@@ -159,19 +159,6 @@ public class PdpMonitoringMain {
         LOGGER.info(PDP_MONITORING_PREFIX + "{}) shutting down", this);
     }
 
-    /**
-     * This class is a shutdown hook for the Pdp services command.
-     */
-    private class PdpServicesShutdownHook implements Runnable {
-        /**
-         * {@inheritDoc}.
-         */
-        @Override
-        public void run() {
-            shutdown();
-        }
-    }
-
     /**
      * Main method, main entry point for command.
      *
index ede9bee..6075049 100644 (file)
@@ -38,6 +38,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import lombok.AllArgsConstructor;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
@@ -243,15 +244,12 @@ public class PdpMonitoringRestResource {
      * A list of values that uses a FIFO sliding window of a fixed size.
      */
     @EqualsAndHashCode(callSuper = true)
+    @AllArgsConstructor
     public class SlidingWindowList<V> extends LinkedList<V> {
         private static final long serialVersionUID = -7187277916025957447L;
 
         private final int maxEntries;
 
-        public SlidingWindowList(final int maxEntries) {
-            this.maxEntries = maxEntries;
-        }
-
         @Override
         public boolean add(final V elm) {
             if (this.size() > (maxEntries - 1)) {
@@ -265,14 +263,10 @@ public class PdpMonitoringRestResource {
      * A class used to storing a single data entry for an engine.
      */
     @Getter
+    @AllArgsConstructor
     public class Counter {
         private final long timestamp;
         private final long value;
-
-        public Counter(final long timestamp, final long value) {
-            this.timestamp = timestamp;
-            this.value = value;
-        }
     }
 
 }