aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroups.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroups.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroups.java
index ab9afb00b..06194eaba 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroups.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroups.java
@@ -41,6 +41,8 @@ import org.onap.policy.common.parameters.ValidationStatus;
@Setter
@ToString
public class PdpGroups {
+ private static final String GROUPS_FIELD = "groups";
+
private List<PdpGroup> groups;
/**
@@ -64,9 +66,9 @@ public class PdpGroups {
* @return the validation result
*/
public ValidationResult validatePapRest() {
- BeanValidationResult result = new BeanValidationResult("groups", this);
+ BeanValidationResult result = new BeanValidationResult(GROUPS_FIELD, this);
- result.validateNotNullList("groups", groups, PdpGroup::validatePapRest);
+ result.validateNotNullList(GROUPS_FIELD, groups, PdpGroup::validatePapRest);
if (!result.isValid()) {
return result;
}
@@ -78,6 +80,6 @@ public class PdpGroups {
}
// different sizes implies duplicates
- return new ObjectValidationResult("groups", names, ValidationStatus.INVALID, "duplicate group names");
+ return new ObjectValidationResult(GROUPS_FIELD, names, ValidationStatus.INVALID, "duplicate group names");
}
}