Add "source" to PAP-PDP messages
[policy/models.git] / models-pdp / src / main / java / org / onap / policy / models / pdp / concepts / DeploymentSubGroup.java
index 1a1fe22..2bf816a 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,17 +24,19 @@ package org.onap.policy.models.pdp.concepts;
 import java.util.ArrayList;
 import java.util.List;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import lombok.NonNull;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.common.parameters.ValidationResult;
 import org.onap.policy.models.base.PfUtils;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
 /**
  * A deployment (i.e., set of policies) for all PDPs of the same pdp type running within a
  * particular domain.
  */
 @Data
+@NoArgsConstructor
 public class DeploymentSubGroup {
 
     public enum Action {
@@ -44,14 +47,7 @@ public class DeploymentSubGroup {
 
     private String pdpType;
     private Action action;
-    private List<ToscaPolicyIdentifier> policies;
-
-    /**
-     * Constructs the object.
-     */
-    public DeploymentSubGroup() {
-        super();
-    }
+    private List<ToscaConceptIdentifier> policies;
 
     /**
      * Constructs the object, making a deep copy from the source.
@@ -61,7 +57,7 @@ public class DeploymentSubGroup {
     public DeploymentSubGroup(@NonNull final DeploymentSubGroup source) {
         this.pdpType = source.pdpType;
         this.action = source.action;
-        this.policies = PfUtils.mapList(source.policies, ToscaPolicyIdentifier::new, new ArrayList<>(0));
+        this.policies = PfUtils.mapList(source.policies, ToscaConceptIdentifier::new, new ArrayList<>(0));
     }
 
     /**
@@ -71,11 +67,11 @@ public class DeploymentSubGroup {
      * @return the validation result
      */
     public ValidationResult validatePapRest() {
-        BeanValidationResult result = new BeanValidationResult("group", this);
+        var result = new BeanValidationResult("group", this);
 
         result.validateNotNull("pdpType", pdpType);
         result.validateNotNull("action", action);
-        result.validateNotNullList("policies", policies, ToscaPolicyIdentifier::validatePapRest);
+        result.validateNotNullList("policies", policies, ToscaConceptIdentifier::validatePapRest);
 
         return result;
     }