* ============LICENSE_START=======================================================
* ONAP Policy Model
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@ElementCollection
@Lob
- private Map<String, String> properties;
+ private Map<String, String> properties = new LinkedHashMap<>();
@ElementCollection
private List<PfConceptKey> targets = new ArrayList<>();
// Add the policy name and version fields to the metadata
getMetadata().put(METADATA_POLICY_ID_TAG, getKey().getName());
- getMetadata().put(METADATA_POLICY_VERSION_TAG, Integer.toString(getKey().getMajorVersion()));
+ getMetadata().put(METADATA_POLICY_VERSION_TAG, getKey().getVersion());
}
@Override
}
if (properties != null) {
- result = validateProperties(result);
+ validateProperties(result);
}
if (targets != null) {
/**
* Validate the policy properties.
*
- * @param result The result of validations up to now
- * @return the validation result
+ * @param result where to put the validation results
*/
- private PfValidationResult validateProperties(final PfValidationResult resultIn) {
- PfValidationResult result = resultIn;
+ private void validateProperties(final PfValidationResult result) {
for (Entry<String, String> propertyEntry : properties.entrySet()) {
if (!ParameterValidationUtils.validateStringParameter(propertyEntry.getKey())) {
"policy property value may not be null "));
}
}
- return result;
}
/**