*
* @param copyConcept the concept to copy from
*/
- public JpaPdpGroup(final JpaPdpGroup copyConcept) {
+ public JpaPdpGroup(@NonNull final JpaPdpGroup copyConcept) {
super(copyConcept);
}
*
* @param authorativeConcept the authorative concept to copy from
*/
- public JpaPdpGroup(final PdpGroup authorativeConcept) {
+ public JpaPdpGroup(@NonNull final PdpGroup authorativeConcept) {
this.fromAuthorative(authorativeConcept);
}
}
@Override
- public void fromAuthorative(final PdpGroup pdpGroup) {
- this.setKey(new PfConceptKey(pdpGroup.getName(), pdpGroup.getVersion()));
+ public void fromAuthorative(@NonNull final PdpGroup pdpGroup) {
+ if (this.key == null || this.getKey().isNullKey()) {
+ this.setKey(new PfConceptKey(pdpGroup.getName(), pdpGroup.getVersion()));
+ }
this.description = pdpGroup.getDescription();
this.pdpGroupState = pdpGroup.getPdpGroupState();
keyList.addAll(jpaPdpSubgroup.getKeys());
}
-
return keyList;
}
}
@Override
- public PfValidationResult validate(final PfValidationResult resultIn) {
+ public PfValidationResult validate(@NonNull final PfValidationResult resultIn) {
PfValidationResult result = resultIn;
if (key.isNullKey()) {
result = key.validate(result);
- if (StringUtils.isBlank(description)) {
+ if (description != null && StringUtils.isBlank(description)) {
result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
"description may not be blank"));
}
+ if (pdpGroupState == null) {
+ result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "pdpGroupState may not be null"));
+ }
+
if (properties != null) {
for (Entry<String, String> propertyEntry : properties.entrySet()) {
if (!ParameterValidationUtils.validateStringParameter(propertyEntry.getKey())) {
}
}
-
if (pdpSubGroups == null) {
result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
"a PDP group must have a list of PDP subgroups"));