Use lombok in apex-pdp #5 72/123072/3
authorJim Hahn <jrh3@att.com>
Mon, 2 Aug 2021 20:36:26 +0000 (16:36 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 6 Aug 2021 18:56:04 +0000 (14:56 -0400)
Updated examples thru integration-executor-test.

Issue-ID: POLICY-3391
Change-Id: Idc707146a646d05720675a787761c199484048e9
Signed-off-by: Jim Hahn <jrh3@att.com>
35 files changed:
examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/concepts/ENodeBStatus.java
examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/concepts/ImsiStatus.java
examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/concepts/IpAddressStatus.java
examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AadmDomainModelSaver.java
examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSProvenActTaskTaskLogic.mvel
examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSSuggestionActTaskTaskLogic.mvel
examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMPolicyActTaskSelectionLogic.mvel
examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmModelTest.java
examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestApexActionListener.java
examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AutoLearn.java
examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelSaver.java
examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionConceptTest.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextByteItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextIntItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextStringItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeMapItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItem.java
testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/TestContextAlbumFactory.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/Constants.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/NetworkUtils.java
testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java
testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModelCreator.java

index 70af74a..650bd82 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.apex.examples.aadm.concepts;
 
 import java.io.Serializable;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * The Class ENodeBStatus holds the status of an eNodeB in the AADM domain.
  */
+@Getter
+@Setter
 public class ENodeBStatus implements Serializable {
     private static final long serialVersionUID = 2852523814242234172L;
 
+    @Getter(AccessLevel.NONE)
     private final String enodeB;
 
     private long dosCount = 0;
@@ -51,24 +58,6 @@ public class ENodeBStatus implements Serializable {
         return enodeB;
     }
 
-    /**
-     * Gets the number of Denial Of Service incidents on the eNodeB.
-     *
-     * @return the number of Denial Of Service incidents on the eNodeB
-     */
-    public long getDosCount() {
-        return dosCount;
-    }
-
-    /**
-     * Sets the number of Denial Of Service incidents on the eNodeB.
-     *
-     * @param incomingDosCount the number of Denial Of Service incidents on the eNodeB
-     */
-    public void setDosCount(final long incomingDosCount) {
-        this.dosCount = incomingDosCount;
-    }
-
     /**
      * Increment DOS count.
      *
@@ -86,22 +75,4 @@ public class ENodeBStatus implements Serializable {
     public long decrementDosCount() {
         return --dosCount;
     }
-
-    /**
-     * Gets the being probed.
-     *
-     * @return the being probed
-     */
-    public boolean getBeingProbed() {
-        return beingProbed;
-    }
-
-    /**
-     * Sets the being probed.
-     *
-     * @param beingProbed the being probed
-     */
-    public void setBeingProbed(final boolean beingProbed) {
-        this.beingProbed = beingProbed;
-    }
 }
index 4b7def0..74f069d 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.apex.examples.aadm.concepts;
 
 import java.io.Serializable;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * The Class IMSIStatus holds the status of an IMSI in the AADM domain.
  */
+@Getter
+@Setter
 public class ImsiStatus implements Serializable {
     private static final long serialVersionUID = 2852523814242234172L;
 
@@ -34,8 +40,10 @@ public class ImsiStatus implements Serializable {
 
     private boolean anomalous = false;
     private long anomalousTime = TIME_NOT_SET;
+    @Getter(AccessLevel.NONE)
+    @Setter(AccessLevel.NONE)
     private String enodeBId;
-    private long blackListedTime = TIME_NOT_SET;
+    private long blacklistedTime = TIME_NOT_SET;
     private long blockingCount = 0;
 
     /**
@@ -47,51 +55,6 @@ public class ImsiStatus implements Serializable {
         this.imsi = imsi;
     }
 
-    /**
-     * Gets the IMSI value.
-     *
-     * @return the IMSI value
-     */
-    public String getImsi() {
-        return imsi;
-    }
-
-    /**
-     * Gets the anomalous flag.
-     *
-     * @return the anomalous flag
-     */
-    public boolean getAnomalous() {
-        return anomalous;
-    }
-
-    /**
-     * Sets the anomalous flag.
-     *
-     * @param anomalous the anomalous flag
-     */
-    public void setAnomalous(final boolean anomalous) {
-        this.anomalous = anomalous;
-    }
-
-    /**
-     * Gets the time of the most recent anomolous event.
-     *
-     * @return the time of the most recent anomolous event
-     */
-    public long getAnomolousTime() {
-        return anomalousTime;
-    }
-
-    /**
-     * Sets the time of the most recent anomolous event.
-     *
-     * @param incomingAnomalousTime the time of the most recent anomolous event
-     */
-    public void setAnomolousTime(final long incomingAnomalousTime) {
-        this.anomalousTime = incomingAnomalousTime;
-    }
-
     /**
      * Gets the eNodeB ID to which the IMSI is attached.
      *
@@ -119,42 +82,6 @@ public class ImsiStatus implements Serializable {
         return (enodeBId != null);
     }
 
-    /**
-     * Gets the time at which the IMSI was blacklisted.
-     *
-     * @return the time at which the IMSI was blacklisted
-     */
-    public long getBlacklistedTime() {
-        return blackListedTime;
-    }
-
-    /**
-     * Sets the time at which the IMSI was blacklisted.
-     *
-     * @param incomingBlackListedTime the time at which the IMSI was blacklisted
-     */
-    public void setBlacklistedTime(final long incomingBlackListedTime) {
-        this.blackListedTime = incomingBlackListedTime;
-    }
-
-    /**
-     * Gets the number of times this IMSI was blocked.
-     *
-     * @return the number of times this IMSI was blocked
-     */
-    public long getBlockingCount() {
-        return blockingCount;
-    }
-
-    /**
-     * Sets the number of times this IMSI was blocked.
-     *
-     * @param blockingCount the number of times this IMSI was blocked
-     */
-    public void setBlockingCount(final long blockingCount) {
-        this.blockingCount = blockingCount;
-    }
-
     /**
      * Increment the number of times this IMSI was blocked.
      *
index 689865b..26f2b41 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.apex.examples.aadm.concepts;
 
 import java.io.Serializable;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * The Class IPAddressStatus holds the status of an IP address in the AADM domain.
  */
+@Getter
+@Setter
 public class IpAddressStatus implements Serializable {
     private static final long serialVersionUID = -7402022458317593252L;
 
@@ -41,33 +46,6 @@ public class IpAddressStatus implements Serializable {
         this.ipAddress = ipAddress;
     }
 
-    /**
-     * Gets the IP address.
-     *
-     * @return the IP address
-     */
-    public String getIpAddress() {
-        return ipAddress;
-    }
-
-    /**
-     * Gets the IMSI.
-     *
-     * @return the imsi
-     */
-    public String getImsi() {
-        return imsi;
-    }
-
-    /**
-     * Sets the IMSI.
-     *
-     * @param incomingImsi the imsi
-     */
-    public void setImsi(final String incomingImsi) {
-        this.imsi = incomingImsi;
-    }
-
     /**
      * Check set IMSI.
      *
index 492769d..52edb31 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -21,6 +22,8 @@
 
 package org.onap.policy.apex.examples.aadm.model;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelSaver;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -32,16 +35,11 @@ import org.slf4j.ext.XLoggerFactory;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class AadmDomainModelSaver {
     // Logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(AadmDomainModelSaver.class);
 
-    /**
-     * Private default constructor to prevent subclassing.
-     */
-    private AadmDomainModelSaver() {
-    }
-
     /**
      * Write the AADM model to args[0].
      *
index 225a0da..7438243 100644 (file)
@@ -1,19 +1,20 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -52,7 +53,7 @@ eNodeBStatus.setBeingProbed(false);
 
 leaveProbingOn = false;
 for (ENodeBStatus enbStatus : getContextAlbum("ENodeBStatusAlbum").values) {
-    if (enbStatus.getBeingProbed()) {
+    if (enbStatus.isBeingProbed()) {
         leaveProbingOn = true;
     }
 }
@@ -67,7 +68,7 @@ logger.debug(eNodeBStatus.getENodeB() + ": dosCount is " + eNodeBStatus.getDosCo
 
 imsiStatus.setAnomalous(false);
 
-logger.debug("imsi: " + imsiStatus.getImsi() + " anamalous " + imsiStatus.getAnomalous());
+logger.debug("imsi: " + imsiStatus.getImsi() + " anamalous " + imsiStatus.isAnomalous());
 
 getContextAlbum("IMSIStatusAlbum")  .put(imsiStatus.getImsi(),     imsiStatus);
 getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
index 63ac8d0..6af2d11 100644 (file)
@@ -1,19 +1,20 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -60,7 +61,7 @@ if (imsiStatus.getENodeBId() != null && !imsiStatus.getENodeBId().equals(inField
         outFields["ACTTASK"] = "remove_from_probe";
 
         for (ENodeBStatus enbStatus : getContextAlbum("ENodeBStatusAlbum").values) {
-            if (enbStatus.getBeingProbed()) {
+            if (enbStatus.isBeingProbed()) {
                 outFields["PROBE_ON"] = true;
                 outFields["TCP_ON"] = true;
                 return true;
@@ -78,7 +79,7 @@ if (imsiStatus.getENodeBId() != null && !imsiStatus.getENodeBId().equals(inField
 }
 
 imsiStatus.setAnomalous(true);
-imsiStatus.setAnomolousTime(System.currentTimeMillis());
+imsiStatus.setAnomalousTime(System.currentTimeMillis());
 imsiStatus.setENodeBId(inFields["ENODEB_ID"]);
 getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getImsi(), imsiStatus);
 logger.debug(imsiStatus.getENodeBId() + ": enodeb added to imsi ip added " + outFields["IMSI_IP"]);
index 9c71db5..2aca804 100644 (file)
@@ -1,19 +1,20 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -33,10 +34,10 @@ if (imsiStatus.getBlockingCount() > 1) {
     return false;
 }
 
-logger.debug("imsi: " + imsiStatus.getImsi() + " anamalous " + imsiStatus.getAnomalous());
+logger.debug("imsi: " + imsiStatus.getImsi() + " anamalous " + imsiStatus.isAnomalous());
 
 // check if this is second iteration
-if (inFields["TCP_UE_SIDE_AVG_THROUGHPUT"] != null && inFields["TCP_UE_SIDE_AVG_THROUGHPUT"] > 100 && imsiStatus.getAnomalous()) {
+if (inFields["TCP_UE_SIDE_AVG_THROUGHPUT"] != null && inFields["TCP_UE_SIDE_AVG_THROUGHPUT"] > 100 && imsiStatus.isAnomalous()) {
     subject.getTaskKey("AADMDoSProvenActTask").copyTo(selectedTask);
     logger.debug("inside TCP_UE_SIDE_AVG_THROUGHPUT");
     return true;
index fe99140..99625f1 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -31,6 +32,8 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
 public class AadmModelTest {
+    private static final String VALID_MODEL_STRING = "***validation of model successful***";
+
     TestApexModel<AxPolicyModel> testApexModel;
 
     /**
@@ -66,6 +69,4 @@ public class AadmModelTest {
 
         testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
-
-    private static final String VALID_MODEL_STRING = "***validation of model successful***";
 }
index 00cf98a..37a916a 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,6 +24,7 @@ package org.onap.policy.apex.examples.aadm;
 
 import java.util.ArrayList;
 import java.util.List;
+import lombok.Getter;
 import org.onap.policy.apex.core.engine.engine.EnEventListener;
 import org.onap.policy.apex.core.engine.event.EnEvent;
 
@@ -37,6 +39,7 @@ import org.onap.policy.apex.core.engine.event.EnEvent;
 public class TestApexActionListener implements EnEventListener {
     List<EnEvent> resultEvents = new ArrayList<EnEvent>();
 
+    @Getter
     private final String id;
 
     /**
@@ -64,13 +67,4 @@ public class TestApexActionListener implements EnEventListener {
     public void onEnEvent(final EnEvent actionEvent) {
         resultEvents.add(actionEvent);
     }
-
-    /**
-     * Gets the id.
-     *
-     * @return the id
-     */
-    public String getId() {
-        return id;
-    }
 }
index b0cff91..10c3610 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications 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.
@@ -26,11 +27,17 @@ import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
 
 /**
  * The Class AnomalyDetection is used as a Java context for Adaptive anomaly detection in the adaptive domain.
  */
+@Getter
+@Setter
 @EqualsAndHashCode
+@ToString
 public class AnomalyDetection implements Serializable {
     private static final long serialVersionUID = -823013127095523727L;
 
@@ -69,60 +76,6 @@ public class AnomalyDetection implements Serializable {
         }
     }
 
-    /**
-     * Indicates if this is the first round of the algorithm.
-     *
-     * @return true if this is the first round of the algorithm
-     */
-    public boolean getFirstRound() {
-        return firstRound;
-    }
-
-    /**
-     * Sets the first round indicator of the algorithm.
-     *
-     * @param firstRound the first round indicator of the algorithm
-     */
-    public void setFirstRound(final boolean firstRound) {
-        this.firstRound = firstRound;
-    }
-
-    /**
-     * Gets the frequency value of the algorithm.
-     *
-     * @return the frequency value of the algorithm
-     */
-    public int getFrequency() {
-        return frequency;
-    }
-
-    /**
-     * Sets the frequency value of the algorithm.
-     *
-     * @param frequency the frequency value of the algorithm
-     */
-    public void setFrequency(final int frequency) {
-        this.frequency = frequency;
-    }
-
-    /**
-     * Gets the anomaly score values of the algorithm.
-     *
-     * @return the anomaly score values of the algorithm
-     */
-    public List<Double> getAnomalyScores() {
-        return anomalyScores;
-    }
-
-    /**
-     * Sets the anomaly score values of the algorithm.
-     *
-     * @param anomalyScores the anomaly score values of the algorithm
-     */
-    public void setAnomalyScores(final List<Double> anomalyScores) {
-        this.anomalyScores = anomalyScores;
-    }
-
     /**
      * Check if the anomaly score values of the algorithm are set.
      *
@@ -139,24 +92,6 @@ public class AnomalyDetection implements Serializable {
         anomalyScores = null;
     }
 
-    /**
-     * Gets the frequency forecasted by the algorithm.
-     *
-     * @return the frequency forecasted by the algorithm
-     */
-    public List<Double> getFrequencyForecasted() {
-        return frequencyForecasted;
-    }
-
-    /**
-     * Sets the frequency forecasted by the algorithm.
-     *
-     * @param frequencyForecasted the frequency forecasted by the algorithm
-     */
-    public void setFrequencyForecasted(final List<Double> frequencyForecasted) {
-        this.frequencyForecasted = frequencyForecasted;
-    }
-
     /**
      * Check if the frequency forecasted by the algorithm is set.
      *
@@ -172,13 +107,4 @@ public class AnomalyDetection implements Serializable {
     public void unsetFrequencyForecasted() {
         frequencyForecasted = null;
     }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "AnomalyDetection [firstRound=" + firstRound + ", frequency=" + frequency + ", anomalyScores="
-                + anomalyScores + ", frequencyForecasted=" + frequencyForecasted + "]";
-    }
 }
index 60c4d96..1760f91 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications 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.
@@ -25,12 +26,16 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
 import lombok.ToString;
 
 /**
  * The Class AutoLearn is used as a Java context for Adaptive auto-learning of trends towards a fixed value in the
  * adaptive domain.
  */
+@Getter
+@Setter
 @EqualsAndHashCode
 @ToString
 public class AutoLearn implements Serializable {
@@ -70,24 +75,6 @@ public class AutoLearn implements Serializable {
         }
     }
 
-    /**
-     * Gets the average difference values of the algorithm.
-     *
-     * @return the average difference values of the algorithm
-     */
-    public List<Double> getAvDiffs() {
-        return avDiffs;
-    }
-
-    /**
-     * Sets the average difference values of the algorithm.
-     *
-     * @param avDiffs the average difference values of the algorithm
-     */
-    public void setAvDiffs(final List<Double> avDiffs) {
-        this.avDiffs = avDiffs;
-    }
-
     /**
      * Check if the average difference values of the algorithm are set.
      *
@@ -104,24 +91,6 @@ public class AutoLearn implements Serializable {
         avDiffs = null;
     }
 
-    /**
-     * Gets the count values of the algorithm.
-     *
-     * @return the count values of the algorithm
-     */
-    public List<Long> getCounts() {
-        return counts;
-    }
-
-    /**
-     * Sets the count values of the algorithm.
-     *
-     * @param counts the count values of the algorithm
-     */
-    public void setCounts(final List<Long> counts) {
-        this.counts = counts;
-    }
-
     /**
      * Check if the count values of the algorithm are set.
      *
index 83a42ac..0ebff49 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -21,6 +22,8 @@
 
 package org.onap.policy.apex.examples.adaptive.model;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelSaver;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -32,17 +35,11 @@ import org.slf4j.ext.XLoggerFactory;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class AdaptiveDomainModelSaver {
     // Logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(AdaptiveDomainModelSaver.class);
 
-    /**
-     * Private default constructor to prevent subclassing.
-     */
-    private AdaptiveDomainModelSaver() {
-        // Prevent subclassing
-    }
-
     /**
      * Write the AADM model to args[0].
      *
index 6b61e82..e059c98 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020-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.
@@ -144,7 +145,7 @@ public class AnomalyDetectionPolicyDecideTaskSelectionLogic {
         }
         anomalyDetection.setFrequency(frequency);
 
-        if (unsetfirstround && anomalyDetection.getFirstRound()) {
+        if (unsetfirstround && anomalyDetection.isFirstRound()) {
             anomalyDetection.setFirstRound(false);
         }
 
@@ -160,7 +161,7 @@ public class AnomalyDetectionPolicyDecideTaskSelectionLogic {
         anomalyDetection.getFrequencyForecasted().set(frequency, forecastedValue);
 
         // anomaly score is ignored in the first frequency period
-        if (!anomalyDetection.getFirstRound()) {
+        if (!anomalyDetection.isFirstRound()) {
             ((LinkedList<Double>) anomalyDetection.getAnomalyScores()).addLast(anomalyScore);
         }
 
index d247332..1237537 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (c) 2020 Nordix Foundation.
  *  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.
@@ -44,8 +45,8 @@ public class AnomalyDetectionConceptTest {
         assertEquals(newAnomalyScores, anomalyDetection.getAnomalyScores());
         assertTrue(anomalyDetection.checkSetAnomalyScores());
         assertEquals(55, anomalyDetection.getFrequency());
-        assertEquals(true, anomalyDetection.getFirstRound());
-        assertEquals("AnomalyDetection [firstRound=true, frequency=55, anomalyScores=[55.0], frequencyForecasted=null]",
+        assertEquals(true, anomalyDetection.isFirstRound());
+        assertEquals("AnomalyDetection(firstRound=true, frequency=55, anomalyScores=[55.0], frequencyForecasted=null)",
             anomalyDetection.toString());
     }
 
index bcb8503..450fffa 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextBooleanItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextBooleanItem implements Serializable {
     private static final long serialVersionUID = 7241008665286367796L;
 
     private boolean flag = false;
-
-    /**
-     * The Constructor.
-     */
-    public TestContextBooleanItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param flag the flag
-     */
-    public TestContextBooleanItem(final Boolean flag) {
-        this.flag = flag;
-    }
 }
index e8e4c62..3865de1 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextByteItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextByteItem implements Serializable {
     private static final long serialVersionUID = 1361938145823720386L;
 
     private byte byteValue = 0;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextByteItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param byteValue the byte value
-     */
-    public TestContextByteItem(final Byte byteValue) {
-        this.byteValue = byteValue;
-    }
-
     public Byte getIncrementedByteValue() {
         return (byte) (byteValue + 1);
     }
index 87c5b23..a550809 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -25,11 +26,13 @@ import java.io.Serializable;
 import java.util.Locale;
 import java.util.TimeZone;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextDateLocaleItem.
  */
 @Data
+@NoArgsConstructor
 public class TestContextDateLocaleItem implements Serializable {
     private static final long serialVersionUID = -6579903685538233754L;
 
@@ -39,12 +42,6 @@ public class TestContextDateLocaleItem implements Serializable {
     private int utcOffset = 0;
     private Locale locale = Locale.ENGLISH;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextDateLocaleItem() {
-    }
-
     /**
      * The Constructor.
      *
index e53f231..91db2ce 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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,12 +24,14 @@ package org.onap.policy.apex.context.test.concepts;
 
 import java.io.Serializable;
 import java.util.TimeZone;
+import lombok.AllArgsConstructor;
 import lombok.Data;
 
 /**
  * The Class TestContextDateTzItem.
  */
 @Data
+@AllArgsConstructor
 public class TestContextDateTzItem implements Serializable {
     private static final long serialVersionUID = 5604426823170331706L;
 
@@ -43,19 +46,6 @@ public class TestContextDateTzItem implements Serializable {
         dst = true;
     }
 
-    /**
-     * The Constructor.
-     *
-     * @param dateValue the date value
-     * @param tzValue the tz value
-     * @param dst the dst
-     */
-    public TestContextDateTzItem(final TestContextDateItem dateValue, final String tzValue, final boolean dst) {
-        this.dateValue = dateValue;
-        this.tzValue = TimeZone.getTimeZone(tzValue).getDisplayName();
-        this.dst = dst;
-    }
-
     /**
      * The Constructor.
      *
index 0a93af5..b385894 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextDoubleItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextDoubleItem implements Serializable {
     private static final long serialVersionUID = -2958758261076734821L;
 
     private double doubleValue = 0;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextDoubleItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param doubleValue the double value
-     */
-    public TestContextDoubleItem(final Double doubleValue) {
-        this.doubleValue = doubleValue;
-    }
-
     public Double getIncrementedDoubleValue() {
         return doubleValue + 1;
     }
index 097f412..48c960a 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextFloatItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextFloatItem implements Serializable {
     private static final long serialVersionUID = -3359180576903272400L;
 
     private float floatValue = 0;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextFloatItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param floatValue the float value
-     */
-    public TestContextFloatItem(final Float floatValue) {
-        this.floatValue = floatValue;
-    }
-
     public Float getIncrementedFloatValue() {
         return floatValue + 1;
     }
index 1907fcd..1db8e4a 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextIntItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextIntItem implements Serializable {
     private static final long serialVersionUID = -8978435658277900984L;
 
     private int intValue = 0;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextIntItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param intValue the int value
-     */
-    public TestContextIntItem(final Integer intValue) {
-        this.intValue = intValue;
-    }
-
     /**
      * The Constructor.
      *
index db1f63d..5fdcd98 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextLongItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextLongItem implements Serializable {
     private static final long serialVersionUID = 3599267534512489386L;
 
     private long longValue = 0;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextLongItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param longValue the long value
-     */
-    public TestContextLongItem(final Long longValue) {
-        this.longValue = longValue;
-    }
-
     public Long getIncrementedLongValue() {
         return longValue + 1;
     }
index d9bb7ed..4956501 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextLongObjectItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextLongObjectItem implements Serializable {
     private static final long serialVersionUID = -1029406737866392421L;
 
     private Long longValue = 0L;
 
-    /**
-     * The Constructor.
-     */
-    public TestContextLongObjectItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param longValue the long value
-     */
-    public TestContextLongObjectItem(final Long longValue) {
-        this.longValue = longValue;
-    }
-
     public Long getIncrementedLongValue() {
         return longValue + 1;
     }
index bb8707c..02eb948 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.apex.context.test.concepts;
 
 import java.io.Serializable;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextStringItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextStringItem implements Serializable {
     private static final long serialVersionUID = -1074772190611125121L;
 
     private String stringValue = "";
-
-    /**
-     * The Constructor.
-     */
-    public TestContextStringItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param stringValue the string value
-     */
-    public TestContextStringItem(final String stringValue) {
-        this.stringValue = stringValue;
-    }
 }
index 602254a..4652fa7 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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,30 +25,18 @@ package org.onap.policy.apex.context.test.concepts;
 import java.io.Serializable;
 import java.util.Map;
 import java.util.TreeMap;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextTreeMapItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextTreeMapItem implements Serializable {
     private static final long serialVersionUID = -7497746259264651884L;
 
     private Map<String, String> mapValue = new TreeMap<>();
-
-    /**
-     * The Constructor.
-     */
-    public TestContextTreeMapItem() {
-        // Default constructor
-    }
-
-    /**
-     * The Constructor.
-     *
-     * @param mapValue the map value
-     */
-    public TestContextTreeMapItem(final Map<String, String> mapValue) {
-        this.mapValue = mapValue;
-    }
 }
index a0c2539..f1d045f 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -25,24 +26,21 @@ import java.io.Serializable;
 import java.util.Arrays;
 import java.util.SortedSet;
 import java.util.TreeSet;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class TestContextTreeSetItem.
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class TestContextTreeSetItem implements Serializable {
     private static final long serialVersionUID = 1254589722957250388L;
 
     private SortedSet<String> setValue = new TreeSet<>();
 
-    /**
-     * The Constructor.
-     */
-    public TestContextTreeSetItem() {
-        // Default constructor
-    }
-
     /**
      * The Constructor.
      *
@@ -51,13 +49,4 @@ public class TestContextTreeSetItem implements Serializable {
     public TestContextTreeSetItem(final String[] setArray) {
         this.setValue = new TreeSet<>(Arrays.asList(setArray));
     }
-
-    /**
-     * The Constructor.
-     *
-     * @param setValue the set value
-     */
-    public TestContextTreeSetItem(final SortedSet<String> setValue) {
-        this.setValue = setValue;
-    }
 }
index d7aba2d..362ccf9 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -21,6 +22,8 @@
 
 package org.onap.policy.apex.testsuites.integration.common.model;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelSaver;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -32,16 +35,11 @@ import org.slf4j.ext.XLoggerFactory;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class SampleDomainModelSaver {
     // Logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(SampleDomainModelSaver.class);
 
-    /**
-     * Private default constructor to prevent subclassing.
-     */
-    private SampleDomainModelSaver() {
-    }
-
     /**
      * Write the sample Models to args[0].
      *
index 19c3d33..3b8394d 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -27,6 +28,11 @@ import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
@@ -37,6 +43,11 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
  */
 @Entity
 @Table(name = "ArtifactKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@AllArgsConstructor
 public class ArtifactKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067896L;
 
@@ -64,25 +75,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         this.doubleValue = doubleValue;
     }
 
-    /**
-     * Instantiates a new artifact key test entity.
-     *
-     * @param key the key
-     * @param doubleValue the double value
-     */
-    public ArtifactKeyTestEntity(final AxArtifactKey key, final Double doubleValue) {
-        this.key = key;
-        this.doubleValue = doubleValue;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public AxArtifactKey getKey() {
-        return key;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -91,15 +83,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         return Arrays.asList((AxKey) getKey());
     }
 
-    /**
-     * Sets the key.
-     *
-     * @param key the new key
-     */
-    public void setKey(final AxArtifactKey key) {
-        this.key = key;
-    }
-
     /**
      * Check set key.
      *
@@ -109,24 +92,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         return (this.key != null);
     }
 
-    /**
-     * Gets the double value.
-     *
-     * @return the double value
-     */
-    public double getDoubleValue() {
-        return doubleValue;
-    }
-
-    /**
-     * Sets the double value.
-     *
-     * @param doubleValue the new double value
-     */
-    public void setDoubleValue(final double doubleValue) {
-        this.doubleValue = doubleValue;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -143,14 +108,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         key.clean();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ArtifactKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -171,42 +128,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         }
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        return result;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public boolean equals(final Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (this == obj) {
-            return true;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) obj;
-        if (key == null) {
-            if (other.key != null) {
-                return false;
-            }
-        } else if (!key.equals(other.key)) {
-            return false;
-        }
-        return (Double.compare(doubleValue, other.doubleValue) == 0);
-    }
-
     /**
      * {@inheritDoc}.
      */
index b325648..da478f0 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -28,6 +29,11 @@ import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
@@ -39,6 +45,11 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
  */
 @Entity
 @Table(name = "ReferenceKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@AllArgsConstructor
 public class ReferenceKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067895L;
 
@@ -67,25 +78,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         this.doubleValue = doubleValue;
     }
 
-    /**
-     * Instantiates a new reference key test entity.
-     *
-     * @param key the key
-     * @param doubleValue the double value
-     */
-    public ReferenceKeyTestEntity(final AxReferenceKey key, final Double doubleValue) {
-        this.key = key;
-        this.doubleValue = doubleValue;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public AxReferenceKey getKey() {
-        return key;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -94,15 +86,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         return Arrays.asList((AxKey) getKey());
     }
 
-    /**
-     * Sets the key.
-     *
-     * @param key the new key
-     */
-    public void setKey(final AxReferenceKey key) {
-        this.key = key;
-    }
-
     /**
      * Check set key.
      *
@@ -112,24 +95,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         return (this.key != null);
     }
 
-    /**
-     * Gets the double value.
-     *
-     * @return the double value
-     */
-    public double getDoubleValue() {
-        return doubleValue;
-    }
-
-    /**
-     * Sets the double value.
-     *
-     * @param doubleValue the new double value
-     */
-    public void setDoubleValue(final double doubleValue) {
-        this.doubleValue = doubleValue;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -146,14 +111,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         key.clean();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ReferenceKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -174,42 +131,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         }
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        return result;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public boolean equals(final Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (this == obj) {
-            return true;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ReferenceKeyTestEntity other = (ReferenceKeyTestEntity) obj;
-        if (key == null) {
-            if (other.key != null) {
-                return false;
-            }
-        } else if (!key.equals(other.key)) {
-            return false;
-        }
-        return (Double.compare(doubleValue, other.doubleValue) == 0);
-    }
-
     /**
      * {@inheritDoc}.
      */
index 4abbc20..be4a379 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -29,6 +30,8 @@ import static org.onap.policy.apex.testsuites.integration.context.utils.Constant
 import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.POLICY_CONTEXT_ALBUM;
 import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.VERSION;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem;
 import org.onap.policy.apex.context.test.concepts.TestContextLongItem;
 import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem;
@@ -48,6 +51,7 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class TestContextAlbumFactory {
     // Recurring string constants.
     private static final String CONTEXT = "context";
@@ -57,13 +61,6 @@ public final class TestContextAlbumFactory {
     private static final String JAVA_LONG = Long.class.getName();
     private static final String JAVA_FLAVOUR = "Java";
 
-    /**
-     * Default constructor to prevent sub-classing.
-     */
-    private TestContextAlbumFactory() {
-        // Private constructor to block subclassing
-    }
-
     /**
      * Creates the policy context model.
      *
index 608a7fc..0b3ac82 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -25,6 +26,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import lombok.Getter;
+import lombok.ToString;
 import org.onap.policy.apex.context.ContextAlbum;
 import org.onap.policy.apex.context.ContextException;
 import org.onap.policy.apex.context.ContextRuntimeException;
@@ -41,9 +44,11 @@ import org.onap.policy.common.utils.validation.Assertions;
 /**
  * The Class ConfigrationProviderImpl provides configuration information for a context test back to the caller.
  */
+@Getter
+@ToString
 public class ConfigrationProviderImpl implements ConfigrationProvider {
 
-    private final String testType;
+    private final String testName;
     private final int jvmCount;
     private final int threadCount;
     private final int loopSize;
@@ -62,7 +67,7 @@ public class ConfigrationProviderImpl implements ConfigrationProvider {
      */
     public ConfigrationProviderImpl(final String testType, final int jvmCount, final int threadCount,
                     final int loopSize, final int albumSize, final int lockType) {
-        this.testType = testType;
+        this.testName = testType;
         this.jvmCount = jvmCount;
         this.threadCount = threadCount;
         this.loopSize = loopSize;
@@ -70,52 +75,12 @@ public class ConfigrationProviderImpl implements ConfigrationProvider {
         this.lockType = LockType.getLockType(lockType);
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getTestName() {
-        return testType;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int getLoopSize() {
-        return loopSize;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int getThreadCount() {
-        return threadCount;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int getJvmCount() {
-        return jvmCount;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int getAlbumSize() {
-        return albumSize;
-    }
-
     /**
      * {@inheritDoc}.
      */
     @Override
     public ExecutorService getExecutorService() {
-        final String name = getThreadFactoryName(jvmCount, testType);
+        final String name = getThreadFactoryName(jvmCount, testName);
         final IntegrationThreadFactory threadFactory = new IntegrationThreadFactory(name);
         return Executors.newFixedThreadPool(threadCount, threadFactory);
     }
@@ -197,14 +162,6 @@ public class ConfigrationProviderImpl implements ConfigrationProvider {
         return lockType.getAlbumModifier();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public LockType getLockType() {
-        return lockType;
-    }
-
     /**
      * Gets the thread factory name.
      *
@@ -216,15 +173,4 @@ public class ConfigrationProviderImpl implements ConfigrationProvider {
         return jvmCount == 1 ? testType + ":TestConcurrentContextThread_0_"
                         : testType + ":TestConcurrentContextJVMThread_";
     }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ConfigrationProviderImpl [testType=" + testType + ", jvmCount=" + jvmCount + ", threadCount="
-                        + threadCount + ", loopSize=" + loopSize + ", albumSize=" + albumSize + ", lockType=" + lockType
-                        + "]";
-    }
-
 }
index e1d8d1a..a5eabd7 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.apex.testsuites.integration.context.utils;
 
 import java.util.TimeZone;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.onap.policy.apex.context.test.concepts.TestPolicyContextItem;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 
 /**
  * The Class Constants provides constants for context tests.
  */
-public class Constants {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class Constants {
     public static final String MAP_CONTEXT_ALBUM = "MapContextAlbum";
     public static final String LONG_CONTEXT_ALBUM = "LongContextAlbum";
     public static final String DATE_CONTEXT_ALBUM = "DateContextAlbum";
@@ -64,13 +68,6 @@ public class Constants {
 
     private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3};
 
-    /**
-     * Instantiates a new constants.
-     */
-    private Constants() {
-        // Private constructor to block subclassing
-    }
-
     /**
      * Gets the ax artifact key array.
      *
index 30bc8d8..a4a1106 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -28,18 +29,14 @@ import java.util.Collections;
 import java.util.Enumeration;
 import java.util.SortedSet;
 import java.util.TreeSet;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 
 /**
  * The Class NetworkUtils contains some utility functions for getting network information for context tests.
  */
-public class NetworkUtils {
-
-    /**
-     * Instantiates a new network utils.
-     */
-    private NetworkUtils() {
-        // Private constructor to block subclassing
-    }
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class NetworkUtils {
 
     /**
      * The JGroups IP address must be set to a real (not loopback) IP address for Infinispan to work. In order to ensure
index 88650c6..da90361 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -22,6 +23,7 @@ package org.onap.policy.apex.testsuites.integration.executor.engine;
 
 import java.util.ArrayList;
 import java.util.List;
+import lombok.Getter;
 import org.onap.policy.apex.core.engine.engine.EnEventListener;
 import org.onap.policy.apex.core.engine.event.EnEvent;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
@@ -41,6 +43,7 @@ public class TestApexActionListener implements EnEventListener {
 
     private List<EnEvent> resultEvents = new ArrayList<>();
 
+    @Getter
     private final String id;
 
     /**
@@ -84,13 +87,4 @@ public class TestApexActionListener implements EnEventListener {
         }
         resultEvents.add(actionEvent);
     }
-
-    /**
-     * Gets the id.
-     *
-     * @return the id
-     */
-    public String getId() {
-        return id;
-    }
 }
index f8afc66..388d9f9 100644 (file)
@@ -1,25 +1,27 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.testsuites.integration.executor.handling;
 
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory;
@@ -29,18 +31,10 @@ import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainMode
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public class TestApexSamplePolicyModelCreator implements TestApexModelCreator<AxPolicyModel> {
     private String logicExecutorType;
 
-    /**
-     * Instantiates a new test apex sample policy model creator.
-     *
-     * @param logicExecutorType the logic executor type
-     */
-    public TestApexSamplePolicyModelCreator(final String logicExecutorType) {
-        this.logicExecutorType = logicExecutorType;
-    }
-
     /**
      * {@inheritDoc}.
      */