summaryrefslogtreecommitdiffstats
path: root/models-pdp/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-03 17:00:16 +0000
committerGerrit Code Review <gerrit@onap.org>2021-05-03 17:00:16 +0000
commitda708d64dc27f36ed5da733fca14ebfb4cc2832b (patch)
tree4af7d16af7c578a885fd9d6f48855299fcf6a5ad /models-pdp/src
parenteb830bfda2a18618032434aa7ebe3501bca2cca7 (diff)
parent4fdecb037bd2609a6b977adba6d2f263c977d9e1 (diff)
Merge "Remove GroupValidationResult"
Diffstat (limited to 'models-pdp/src')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/DeploymentGroup.java10
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java9
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpSubGroup.java9
3 files changed, 10 insertions, 18 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/DeploymentGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/DeploymentGroup.java
index d98f6ed30..8746c0721 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/DeploymentGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/DeploymentGroup.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 AT&T Intellectual Property.
+ * Copyright (C) 2019, 2021 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import org.onap.policy.common.parameters.BeanValidationResult;
-import org.onap.policy.common.parameters.ObjectValidationResult;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.models.base.PfUtils;
@@ -70,8 +69,7 @@ public class DeploymentGroup {
result.validateNotNullList(SUBGROUP_FIELD, deploymentSubgroups, DeploymentSubGroup::validatePapRest);
if (deploymentSubgroups != null && deploymentSubgroups.isEmpty()) {
- result.addResult(new ObjectValidationResult(SUBGROUP_FIELD, deploymentSubgroups, ValidationStatus.INVALID,
- "is empty"));
+ result.addResult(SUBGROUP_FIELD, deploymentSubgroups, ValidationStatus.INVALID, "is empty");
}
checkDuplicateSubgroups(result);
@@ -102,8 +100,8 @@ public class DeploymentGroup {
if (curact != null && action == Action.PATCH) {
BeanValidationResult subResult = new BeanValidationResult(pdpType, pdpType);
- subResult.addResult(new ObjectValidationResult("action", action, ValidationStatus.INVALID,
- "incompatible with previous action: " + curact));
+ subResult.addResult("action", action, ValidationStatus.INVALID,
+ "incompatible with previous action: " + curact);
BeanValidationResult subResult2 = new BeanValidationResult(SUBGROUP_FIELD, subgrp);
subResult2.addResult(subResult);
result.addResult(subResult2);
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
index b6886bef1..6d7607924 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@ import java.util.stream.Collectors;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.onap.policy.common.parameters.BeanValidationResult;
-import org.onap.policy.common.parameters.ObjectValidationResult;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.models.base.PfKey;
@@ -96,8 +95,7 @@ public class PdpGroup implements PfNameVersion, Comparable<PdpGroup> {
(PdpSubGroup pdpSubGroup) -> pdpSubGroup.validatePapRest(updateGroupFlow));
if (pdpSubgroups != null && pdpSubgroups.isEmpty()) {
- result.addResult(new ObjectValidationResult(SUBGROUP_FIELD, pdpSubgroups, ValidationStatus.INVALID,
- "is empty"));
+ result.addResult(SUBGROUP_FIELD, pdpSubgroups, ValidationStatus.INVALID, "is empty");
}
checkDuplicateSubgroups(result);
@@ -122,8 +120,7 @@ public class PdpGroup implements PfNameVersion, Comparable<PdpGroup> {
}
// different sizes implies duplicates
- result.addResult(new ObjectValidationResult(SUBGROUP_FIELD, pdpTypes, ValidationStatus.INVALID,
- "duplicate subgroups"));
+ result.addResult(SUBGROUP_FIELD, pdpTypes, ValidationStatus.INVALID, "duplicate subgroups");
}
@Override
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpSubGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpSubGroup.java
index bfd9dac95..0e9554d03 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpSubGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpSubGroup.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019, 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,7 +28,6 @@ import java.util.Map;
import lombok.Data;
import lombok.NonNull;
import org.onap.policy.common.parameters.BeanValidationResult;
-import org.onap.policy.common.parameters.ObjectValidationResult;
import org.onap.policy.common.parameters.ValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.models.base.PfUtils;
@@ -91,14 +90,12 @@ public class PdpSubGroup {
ToscaConceptIdentifier::validatePapRest);
if (supportedPolicyTypes != null && supportedPolicyTypes.isEmpty()) {
- result.addResult(new ObjectValidationResult("supportedPolicyTypes", supportedPolicyTypes,
- ValidationStatus.INVALID, "empty list"));
+ result.addResult("supportedPolicyTypes", supportedPolicyTypes, ValidationStatus.INVALID, "empty list");
}
}
if (desiredInstanceCount <= 0) {
- result.addResult(new ObjectValidationResult("desiredInstanceCount", desiredInstanceCount,
- ValidationStatus.INVALID, "non-positive"));
+ result.addResult("desiredInstanceCount", desiredInstanceCount, ValidationStatus.INVALID, "non-positive");
}
return result;